Closed
Bug 485269
Opened 15 years ago
Closed 14 years ago
add head.js and cleanup functions to browser chrome tests
Categories
(Testing :: Mochitest, defect)
Testing
Mochitest
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla1.9.3a1
People
(Reporter: ddahl, Assigned: mak)
References
Details
(Keywords: dev-doc-complete)
Attachments
(1 file, 4 obsolete files)
4.32 KB,
patch
|
Details | Diff | Splinter Review |
It would be nice to have a module or head.js for browser chrome testing, for instance all places tests would want to call this function on end: var hs = Cc["@mozilla.org/browser/nav-history-service;1"]. getService(Ci.nsINavHistoryService); var mDBConn = hs.QueryInterface(Ci.nsPIPlacesDatabase).DBConnection; function cleanDatabase() { mDBConn.executeSimpleSQL("DELETE FROM moz_places"); mDBConn.executeSimpleSQL("DELETE FROM moz_historyvisits"); mDBConn.executeSimpleSQL("DELETE FROM moz_anno_attributes"); mDBConn.executeSimpleSQL("DELETE FROM moz_annos"); mDBConn.executeSimpleSQL("DELETE FROM moz_items_annos"); mDBConn.executeSimpleSQL("DELETE FROM moz_inputhistory"); mDBConn.executeSimpleSQL("DELETE FROM moz_keywords"); mDBConn.executeSimpleSQL("DELETE FROM moz_favicons"); var sql = "DELETE FROM moz_bookmarks WHERE id NOT IN (SELECT folder_id from moz_bookmarks_roots)"; mDBConn.executeSimpleSQL(sql); }
Assignee | ||
Comment 1•15 years ago
|
||
i hope to have some time to take a look at this, no promises though.
Assignee: nobody → mak77
Assignee | ||
Updated•15 years ago
|
Summary: head.js or javascript module for places browser chrome tests → head.js or javascript module for browser chrome tests
Assignee | ||
Updated•15 years ago
|
Component: Places → BrowserTest
Product: Firefox → Testing
QA Contact: places → browsertest
Assignee | ||
Comment 2•15 years ago
|
||
i thought this was harder, looks like just so easy.
Assignee | ||
Comment 3•15 years ago
|
||
forgot auto-test files.
Attachment #412394 -
Attachment is obsolete: true
Assignee | ||
Comment 4•15 years ago
|
||
Comment on attachment 412395 [details] [diff] [review] patch v1.1 gavin, feedback about this?
Attachment #412395 -
Flags: review?(gavin.sharp)
Assignee | ||
Updated•15 years ago
|
Summary: head.js or javascript module for browser chrome tests → add head.js and cleanup functions to browser chrome tests
Assignee | ||
Comment 5•15 years ago
|
||
applies on top of bug 528469 (by using this._scriptLoader). Adds head.js, and support for registerCleanupFunction(aFunction), that is a similar functionality to what we have in xpcshell tests, you can register one or more functions that will be run after the test finishes, and before starting next test.
Attachment #412395 -
Attachment is obsolete: true
Attachment #414096 -
Flags: review?(gavin.sharp)
Attachment #412395 -
Flags: review?(gavin.sharp)
Assignee | ||
Updated•15 years ago
|
Flags: in-testsuite?
Assignee | ||
Comment 6•15 years ago
|
||
pushed to the tryserver and got green
Assignee | ||
Updated•15 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 7•15 years ago
|
||
unbitrot against new patch in bug 528469
Attachment #414096 -
Attachment is obsolete: true
Attachment #414096 -
Flags: review?(gavin.sharp)
Assignee | ||
Updated•15 years ago
|
Whiteboard: to be applied on top of patch in bug 528469
Assignee | ||
Updated•15 years ago
|
Attachment #421859 -
Flags: review?(gavin.sharp)
Assignee | ||
Comment 8•15 years ago
|
||
my push of all the three patches about b-c tests has gone green.
Updated•14 years ago
|
Attachment #421859 -
Flags: review?(gavin.sharp) → review+
Comment 9•14 years ago
|
||
Comment on attachment 421859 [details] [diff] [review] patch v1.3 >diff --git a/testing/mochitest/browser-test.js b/testing/mochitest/browser-test.js > realNextTest: function Test_realNextTest() { >+ if (this.currentTest) { >+ // Run registered cleanup functions for the previous test. "Run cleanup functions for the current test before moving on to the next". I think this code should go into nextTest() before the call to waitForWindowState, though, since the cleanup functions could potentially be used to clean up windows, right? >diff --git a/testing/mochitest/tests/browser/Makefile.in b/testing/mochitest/tests/browser/Makefile.in >-_BROWSER_TEST_FILES = browser_pass.js \ >+_BROWSER_TEST_FILES = \ >+ head.js \ >+ browser_head.js \ >+ browser_pass.js \ > browser_async.js \ fix the indent here? r=me with those addressed. Should probably add some documentation to this on the MDC page: https://developer.mozilla.org/En/Browser_chrome_tests
Assignee | ||
Updated•14 years ago
|
Keywords: dev-doc-needed
Assignee | ||
Comment 10•14 years ago
|
||
Addressed comments. Yes makes MUCH sense running cleanup functions before checking windows status.
Attachment #421859 -
Attachment is obsolete: true
Assignee | ||
Comment 11•14 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/cd5868a825d8
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Flags: in-testsuite? → in-testsuite+
Resolution: --- → FIXED
Whiteboard: to be applied on top of patch in bug 528469
Assignee | ||
Updated•14 years ago
|
Hardware: x86 → All
Target Milestone: --- → mozilla1.9.3a1
Assignee | ||
Comment 12•14 years ago
|
||
updated https://developer.mozilla.org/en/Browser_chrome_tests
Keywords: dev-doc-needed → dev-doc-complete
Updated•6 years ago
|
Component: BrowserTest → Mochitest
You need to log in
before you can comment on or make changes to this bug.
Description
•