author | Alexandre Poirot <poirot.alex@gmail.com> |
Wed, 09 Nov 2016 09:21:17 -0800 | |
changeset 324356 | c307daee56b588148e7853a74a3190bf64034499 |
parent 324355 | 7f137d9fa7ba6f092eb1821b3972ff2f1ea85a12 |
child 324357 | fb4f5c7e082a4176cd1b8f3c784e5f424417e3fa |
push id | 34675 |
push user | apoirot@mozilla.com |
push date | Mon, 28 Nov 2016 10:02:55 +0000 |
treeherder | autoland@fb4f5c7e082a [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | pbro |
bugs | 1151909 |
milestone | 53.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
devtools/client/inspector/markup/test/browser_markup_load_01.js | file | annotate | diff | comparison | revisions |
--- a/devtools/client/inspector/markup/test/browser_markup_load_01.js +++ b/devtools/client/inspector/markup/test/browser_markup_load_01.js @@ -23,45 +23,56 @@ server.registerPathHandler("/slow.gif", }); // Test page load events. const TEST_URL = "data:text/html," + "<!DOCTYPE html>" + "<head><meta charset='utf-8' /></head>" + "<body>" + "<p>Slow script</p>" + - "<img src='http://localhost:" + server.identity.primaryPort + "/slow.gif' /></script>" + + "<img src='http://localhost:" + server.identity.primaryPort + "/slow.gif' />" + "</body>" + "</html>"; add_task(function* () { let {inspector, testActor, tab} = yield openInspectorForURL(TEST_URL); + let domContentLoaded = waitForLinkedBrowserEvent(tab, "DOMContentLoaded"); let pageLoaded = waitForLinkedBrowserEvent(tab, "load"); ok(inspector.markup, "There is a markup view"); // Select an element while the tab is in the middle of a slow reload. testActor.eval("location.reload()"); + + info("Wait for DOMContentLoaded"); yield domContentLoaded; - yield chooseWithInspectElementContextMenu("img", testActor); + + info("Inspect element via context menu"); + let markupLoaded = inspector.once("markuploaded"); + let multipleChildrenUpdates = waitForMultipleChildrenUpdates(inspector); + yield chooseWithInspectElementContextMenu("img", tab); + + info("Wait for load"); yield pageLoaded; - yield inspector.once("markuploaded"); - yield waitForMultipleChildrenUpdates(inspector); + info("Wait for markup-loaded after element inspection"); + yield markupLoaded; + info("Wait for multiple children updates after element inspection"); + yield multipleChildrenUpdates; ok(inspector.markup, "There is a markup view"); is(inspector.markup._elt.children.length, 1, "The markup view is rendering"); }); -function* chooseWithInspectElementContextMenu(selector, testActor) { +function* chooseWithInspectElementContextMenu(selector, tab) { yield BrowserTestUtils.synthesizeMouseAtCenter(selector, { type: "contextmenu", button: 2 - }, gBrowser.selectedBrowser); + }, tab.linkedBrowser); yield EventUtils.synthesizeKey("Q", {}); } function waitForLinkedBrowserEvent(tab, event) { let def = defer(); tab.linkedBrowser.addEventListener(event, function cb() { tab.linkedBrowser.removeEventListener(event, cb, true);