Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Unified Diff: chrome/test/data/extensions/api_test/webnavigation/test_openTab.js

Issue 7859014: Refactor ExtensionApiTest.WebNavigationEvents* to not rely on window.setTimeout (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/webnavigation/test_openTab.js
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_openTab.js b/chrome/test/data/extensions/api_test/webnavigation/test_openTab.js
index 2f4e5a4bf849c15a44fb1adbe4736fa661c1ca7e..5b33110ddcaae093469df7c438c49c5d2ef0d9a0 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_openTab.js
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_openTab.js
@@ -11,134 +11,166 @@ function runTests() {
// Opens a new tab from javascript.
function openTab() {
expect([
- [ "onBeforeNavigate",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('openTab/a.html') }],
- [ "onCommitted",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- transitionQualifiers: [],
- transitionType: "link",
- url: getURL('openTab/a.html') }],
- [ "onDOMContentLoaded",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('openTab/a.html') }],
- [ "onCompleted",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('openTab/a.html') }],
- [ "onCreatedNavigationTarget",
- { sourceFrameId: 0,
- sourceTabId: 0,
- tabId: 1,
- timeStamp: 0,
- url: getURL('openTab/b.html') }],
- [ "onBeforeNavigate",
- { frameId: 0,
- tabId: 1,
- timeStamp: 0,
- url: getURL('openTab/b.html') }],
- [ "onCommitted",
- { frameId: 0,
- tabId: 1,
- timeStamp: 0,
- transitionQualifiers: [],
- transitionType: "link",
- url: getURL('openTab/b.html') }],
- [ "onDOMContentLoaded",
- { frameId: 0,
- tabId: 1,
- timeStamp: 0,
- url: getURL('openTab/b.html') }],
- [ "onCompleted",
- { frameId: 0,
- tabId: 1,
- timeStamp: 0,
- url: getURL('openTab/b.html') }]]);
+ { label: "a-onBeforeNavigate",
+ event: "onBeforeNavigate",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('openTab/a.html') }},
+ { label: "a-onCommitted",
+ event: "onCommitted",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ transitionQualifiers: [],
+ transitionType: "link",
+ url: getURL('openTab/a.html') }},
+ { label: "a-onDOMContentLoaded",
+ event: "onDOMContentLoaded",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('openTab/a.html') }},
+ { label: "a-onCompleted",
+ event: "onCompleted",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('openTab/a.html') }},
+ { label: "a-onCreatedNavigationTarget",
+ event: "onCreatedNavigationTarget",
+ details: { sourceFrameId: 0,
+ sourceTabId: 0,
+ tabId: 1,
+ timeStamp: 0,
+ url: getURL('openTab/b.html') }},
+ { label: "b-onBeforeNavigate",
+ event: "onBeforeNavigate",
+ details: { frameId: 0,
+ tabId: 1,
+ timeStamp: 0,
+ url: getURL('openTab/b.html') }},
+ { label: "b-onCommitted",
+ event: "onCommitted",
+ details: { frameId: 0,
+ tabId: 1,
+ timeStamp: 0,
+ transitionQualifiers: [],
+ transitionType: "link",
+ url: getURL('openTab/b.html') }},
+ { label: "b-onDOMContentLoaded",
+ event: "onDOMContentLoaded",
+ details: { frameId: 0,
+ tabId: 1,
+ timeStamp: 0,
+ url: getURL('openTab/b.html') }},
+ { label: "b-onCompleted",
+ event: "onCompleted",
+ details: { frameId: 0,
+ tabId: 1,
+ timeStamp: 0,
+ url: getURL('openTab/b.html') }}],
+ [ navigationOrder("a-"),
+ navigationOrder("b-"),
+ ["a-onDOMContentLoaded", "a-onCreatedNavigationTarget",
+ "b-onBeforeNavigate"]]);
chrome.tabs.update(tabId, { url: getURL('openTab/a.html') });
},
// Opens a new tab from javascript within an iframe.
function openTabFrame() {
expect([
- [ "onBeforeNavigate",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('openTab/c.html') }],
- [ "onCommitted",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- transitionQualifiers: [],
- transitionType: "link",
- url: getURL('openTab/c.html') }],
- [ "onBeforeNavigate",
- { frameId: 1,
- tabId: 0,
- timeStamp: 0,
- url: getURL('openTab/a.html') }],
- [ "onDOMContentLoaded",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('openTab/c.html') }],
- [ "onCommitted",
- { frameId: 1,
- tabId: 0,
- timeStamp: 0,
- transitionQualifiers: [],
- transitionType: "auto_subframe",
- url: getURL('openTab/a.html') }],
- [ "onDOMContentLoaded",
- { frameId: 1,
- tabId: 0,
- timeStamp: 0,
- url: getURL('openTab/a.html') }],
- [ "onCompleted",
- { frameId: 1,
- tabId: 0,
- timeStamp: 0,
- url: getURL('openTab/a.html') }],
- [ "onCompleted",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('openTab/c.html') }],
- [ "onCreatedNavigationTarget",
- { sourceFrameId: 1,
- sourceTabId: 0,
- tabId: 1,
- timeStamp: 0,
- url: getURL('openTab/b.html') }],
- [ "onBeforeNavigate",
- { frameId: 0,
- tabId: 1,
- timeStamp: 0,
- url: getURL('openTab/b.html') }],
- [ "onCommitted",
- { frameId: 0,
- tabId: 1,
- timeStamp: 0,
- transitionQualifiers: [],
- transitionType: "link",
- url: getURL('openTab/b.html') }],
- [ "onDOMContentLoaded",
- { frameId: 0,
- tabId: 1,
- timeStamp: 0,
- url: getURL('openTab/b.html') }],
- [ "onCompleted",
- { frameId: 0,
- tabId: 1,
- timeStamp: 0,
- url: getURL('openTab/b.html') }]]);
+ { label: "c-onBeforeNavigate",
+ event: "onBeforeNavigate",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('openTab/c.html') }},
+ { label: "c-onCommitted",
+ event: "onCommitted",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ transitionQualifiers: [],
+ transitionType: "link",
+ url: getURL('openTab/c.html') }},
+ { label: "c-onDOMContentLoaded",
+ event: "onDOMContentLoaded",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('openTab/c.html') }},
+ { label: "c-onCompleted",
+ event: "onCompleted",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('openTab/c.html') }},
+ { label: "a-onBeforeNavigate",
+ event: "onBeforeNavigate",
+ details: { frameId: 1,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('openTab/a.html') }},
+ { label: "a-onCommitted",
+ event: "onCommitted",
+ details: { frameId: 1,
+ tabId: 0,
+ timeStamp: 0,
+ transitionQualifiers: [],
+ transitionType: "auto_subframe",
+ url: getURL('openTab/a.html') }},
+ { label: "a-onDOMContentLoaded",
+ event: "onDOMContentLoaded",
+ details: { frameId: 1,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('openTab/a.html') }},
+ { label: "a-onCompleted",
+ event: "onCompleted",
+ details: { frameId: 1,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('openTab/a.html') }},
+ { label: "a-onCreatedNavigationTarget",
+ event: "onCreatedNavigationTarget",
+ details: { sourceFrameId: 1,
+ sourceTabId: 0,
+ tabId: 1,
+ timeStamp: 0,
+ url: getURL('openTab/b.html') }},
+ { label: "b-onBeforeNavigate",
+ event: "onBeforeNavigate",
+ details: { frameId: 0,
+ tabId: 1,
+ timeStamp: 0,
+ url: getURL('openTab/b.html') }},
+ { label: "b-onCommitted",
+ event: "onCommitted",
+ details: { frameId: 0,
+ tabId: 1,
+ timeStamp: 0,
+ transitionQualifiers: [],
+ transitionType: "link",
+ url: getURL('openTab/b.html') }},
+ { label: "b-onDOMContentLoaded",
+ event: "onDOMContentLoaded",
+ details: { frameId: 0,
+ tabId: 1,
+ timeStamp: 0,
+ url: getURL('openTab/b.html') }},
+ { label: "b-onCompleted",
+ event: "onCompleted",
+ details: { frameId: 0,
+ tabId: 1,
+ timeStamp: 0,
+ url: getURL('openTab/b.html') }}],
+ [ navigationOrder("a-"),
+ navigationOrder("b-"),
+ navigationOrder("c-"),
+ isIFrameOf("a-", "c-"),
+ ["a-onDOMContentLoaded", "a-onCreatedNavigationTarget",
+ "b-onBeforeNavigate"]]);
chrome.tabs.update(tabId, { url: getURL('openTab/c.html') });
},
]);

Powered by Google App Engine
This is Rietveld 408576698