summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/extensions/extension_webnavigation_apitest.cc9
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/clientRedirect/a.html4
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/failures/b.html4
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/forwardBack/a.html10
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/forwardBack/b.html4
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/framework.js86
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/iframe/b.html4
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/iframe/f.html4
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/iframe/i.html2
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/openTab/a.html2
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/referenceFragment/a.html4
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_clientRedirect.js103
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_failures.js225
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_forwardBack.js146
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_iframe.js498
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_openTab.js276
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_referenceFragment.js64
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_serverRedirect.js52
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_simpleLoad.js49
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_userAction.js114
20 files changed, 949 insertions, 711 deletions
diff --git a/chrome/browser/extensions/extension_webnavigation_apitest.cc b/chrome/browser/extensions/extension_webnavigation_apitest.cc
index a7d2afa..f7a6fa64 100644
--- a/chrome/browser/extensions/extension_webnavigation_apitest.cc
+++ b/chrome/browser/extensions/extension_webnavigation_apitest.cc
@@ -144,14 +144,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, WebNavigationFailures) {
RunExtensionSubtest("webnavigation", "test_failures.html")) << message_;
}
-// Fails almost consistently on Mac only. http://crbug.com/94932
-#if defined(OS_MACOSX)
-#define MAYBE_WebNavigationUserAction FAILS_WebNavigationUserAction
-#else
-#define MAYBE_WebNavigationUserAction WebNavigationUserAction
-#endif
-
-IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_WebNavigationUserAction) {
+IN_PROC_BROWSER_TEST_F(ExtensionApiTest, WebNavigationUserAction) {
CommandLine::ForCurrentProcess()->AppendSwitch(
switches::kEnableExperimentalExtensionApis);
diff --git a/chrome/test/data/extensions/api_test/webnavigation/clientRedirect/a.html b/chrome/test/data/extensions/api_test/webnavigation/clientRedirect/a.html
index 3e3e11a..9c8afe8 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/clientRedirect/a.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/clientRedirect/a.html
@@ -1,3 +1 @@
-<script>
- window.setTimeout('document.location = "b.html";', 500);
-</script>
+<body onload="document.location='b.html'"></body>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/failures/b.html b/chrome/test/data/extensions/api_test/webnavigation/failures/b.html
index d6e86d8..33413d3 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/failures/b.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/failures/b.html
@@ -1,3 +1 @@
-<script>
- window.setTimeout('document.location = "c.html";', 500);
-</script>
+<body onload="document.location = 'c.html'"></body>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/forwardBack/a.html b/chrome/test/data/extensions/api_test/webnavigation/forwardBack/a.html
index 7b3462c..b0b6c8b 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/forwardBack/a.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/forwardBack/a.html
@@ -1,6 +1,14 @@
+<html>
+<head>
<script>
+function navigate() {
if (window.sessionStorage['redirected'] != 1) {
window.sessionStorage['redirected'] = 1;
- window.setTimeout('document.location = "b.html";', 500);
+ // Required so this results in a history entry being created.
+ window.setTimeout('document.location = "b.html"', 0);
}
+}
</script>
+</head>
+<body onload="navigate()"></body>
+</html>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/forwardBack/b.html b/chrome/test/data/extensions/api_test/webnavigation/forwardBack/b.html
index a4270ed..8fb41fd 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/forwardBack/b.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/forwardBack/b.html
@@ -1,3 +1 @@
-<script>
- window.setTimeout('history.back();', 500);
-</script>
+<body onload="history.back();"></body>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/framework.js b/chrome/test/data/extensions/api_test/webnavigation/framework.js
index b45db89..cf5a58c 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/framework.js
+++ b/chrome/test/data/extensions/api_test/webnavigation/framework.js
@@ -2,7 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+var deepEq = chrome.test.checkDeepEq;
var expectedEventData;
+var expectedEventOrder;
var capturedEventData;
var nextFrameId;
var frameIds;
@@ -10,9 +12,18 @@ var nextTabId;
var tabIds;
var initialized = false;
-function expect(data) {
+// data: array of expected events, each one is a dictionary:
+// { label: "<unique identifier>",
+// event: "<webnavigation event type>",
+// details: { <expected details of the event> }
+// }
+// order: an array of sequences, e.g. [ ["a", "b", "c"], ["d", "e"] ] means that
+// event with label "a" needs to occur before event with label "b". The
+// relative order of "a" and "d" does not matter.
+function expect(data, order) {
expectedEventData = data;
capturedEventData = [];
+ expectedEventOrder = order;
nextFrameId = 1;
frameIds = {};
nextTabId = 0;
@@ -24,8 +35,35 @@ function checkExpectations() {
if (capturedEventData.length < expectedEventData.length) {
return;
}
- chrome.test.assertEq(JSON.stringify(expectedEventData),
- JSON.stringify(capturedEventData));
+ if (capturedEventData.length > expectedEventData.length) {
+ chrome.test.fail("Recorded too many events. " +
+ JSON.stringify(capturedEventData));
+ }
+ // We have ensured that capturedEventData contains exactly the same elements
+ // as expectedEventData. Now we need to verify the ordering.
+ // Step 1: build positions such that
+ // position[<event-label>]=<position of this event in capturedEventData>
+ var curPos = 0;
+ var positions = {};
+ capturedEventData.forEach(function (event) {
+ chrome.test.assertTrue(event.hasOwnProperty("label"));
+ positions[event.label] = curPos;
+ curPos++;
+ });
+ // Step 2: check that elements arrived in correct order
+ expectedEventOrder.forEach(function (order) {
+ var previousLabel = undefined;
+ order.forEach(function (label) {
+ if (previousLabel === undefined) {
+ previousLabel = label;
+ return;
+ }
+ chrome.test.assertTrue(positions[previousLabel] < positions[label],
+ "Event " + previousLabel + " is supposed to arrive before " +
+ label + ".");
+ previousLabel = label;
+ });
+ });
chrome.test.succeed();
}
@@ -62,7 +100,24 @@ function captureEvent(name, details) {
}
details.sourceTabId = tabIds[details.sourceTabId];
}
- capturedEventData.push([name, details]);
+
+ // find |details| in expectedEventData
+ var found = false;
+ var label = undefined;
+ expectedEventData.forEach(function (exp) {
+ if (deepEq(exp.event, name) && deepEq(exp.details, details)) {
+ if (!found) {
+ found = true;
+ label = exp.label;
+ exp.event = undefined;
+ }
+ }
+ });
+ if (!found) {
+ chrome.test.fail("Received unexpected event '" + name + "':" +
+ JSON.stringify(details));
+ }
+ capturedEventData.push({label: label, event: name, details: details});
checkExpectations();
}
@@ -99,3 +154,26 @@ function initListeners() {
captureEvent("onErrorOccurred", details);
});
}
+
+// Returns the usual order of navigation events.
+function navigationOrder(prefix) {
+ return [ prefix + "onBeforeNavigate",
+ prefix + "onCommitted",
+ prefix + "onDOMContentLoaded",
+ prefix + "onCompleted" ];
+}
+
+// Returns the constraints expressing that a frame is an iframe of another
+// frame.
+function isIFrameOf(iframe, main_frame) {
+ return [ main_frame + "onCommitted",
+ iframe + "onBeforeNavigate",
+ main_frame + "onDOMContentLoaded",
+ iframe + "onCompleted",
+ main_frame + "onCompleted" ];
+}
+
+// Returns the constraint expressing that a frame was loaded by another.
+function isLoadedBy(target, source) {
+ return [ source + "onDOMContentLoaded", target + "onBeforeNavigate"];
+}
diff --git a/chrome/test/data/extensions/api_test/webnavigation/iframe/b.html b/chrome/test/data/extensions/api_test/webnavigation/iframe/b.html
index d6e86d8..c5741ef 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/iframe/b.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/iframe/b.html
@@ -1,3 +1 @@
-<script>
- window.setTimeout('document.location = "c.html";', 500);
-</script>
+<body onload='document.location = "c.html"'></body>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/iframe/f.html b/chrome/test/data/extensions/api_test/webnavigation/iframe/f.html
index b623f77..993b37a 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/iframe/f.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/iframe/f.html
@@ -1,3 +1 @@
-<script>
- window.setTimeout('document.location = "g.html";', 500);
-</script>
+<body onload='document.location = "g.html"'></body>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/iframe/i.html b/chrome/test/data/extensions/api_test/webnavigation/iframe/i.html
index ef7d7b9..89f750c 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/iframe/i.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/iframe/i.html
@@ -7,6 +7,6 @@ function navigate() {
}
</script>
</head>
-<body onload="window.setTimeout('navigate()', 500);"></body>
+<body onload="navigate()"></body>
</body>
</html>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/openTab/a.html b/chrome/test/data/extensions/api_test/webnavigation/openTab/a.html
index fedfc5f..f318e9c 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/openTab/a.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/openTab/a.html
@@ -1 +1 @@
-<script>window.setTimeout('window.open("b.html")', 500);</script>
+<body onload='window.open("b.html")'></body>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/referenceFragment/a.html b/chrome/test/data/extensions/api_test/webnavigation/referenceFragment/a.html
index 17edd07..6a43763 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/referenceFragment/a.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/referenceFragment/a.html
@@ -1,3 +1 @@
-<script>
- window.setTimeout('document.location = "a.html#anchor";', 500);
-</script>
+<body onload='document.location = "a.html#anchor";'></body>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_clientRedirect.js b/chrome/test/data/extensions/api_test/webnavigation/test_clientRedirect.js
index a6ed172..79082c8 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_clientRedirect.js
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_clientRedirect.js
@@ -7,55 +7,64 @@ function runTests() {
chrome.tabs.create({"url": "about:blank"}, function(tab) {
var tabId = tab.id;
chrome.test.runTests([
- // Navigates to a.html that redirects to b.html (using javascript)
- // after a delay of 500ms, so the initial navigation is completed and
- // the redirection is marked as client_redirect.
+ // Navigates to a.html that redirects to b.html (using javascript).
function clientRedirect() {
expect([
- [ "onBeforeNavigate",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('clientRedirect/a.html') }],
- [ "onCommitted",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- transitionQualifiers: [],
- transitionType: "link",
- url: getURL('clientRedirect/a.html') }],
- [ "onDOMContentLoaded",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('clientRedirect/a.html') }],
- [ "onCompleted",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('clientRedirect/a.html') }],
- [ "onBeforeNavigate",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('clientRedirect/b.html') }],
- [ "onCommitted",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- transitionQualifiers: ["client_redirect"],
- transitionType: "link",
- url: getURL('clientRedirect/b.html') }],
- [ "onDOMContentLoaded",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('clientRedirect/b.html') }],
- [ "onCompleted",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('clientRedirect/b.html') }]]);
+ { label: "a-onBeforeNavigate",
+ event: "onBeforeNavigate",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('clientRedirect/a.html') }},
+ { label: "a-onCommitted",
+ event: "onCommitted",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ transitionQualifiers: [],
+ transitionType: "link",
+ url: getURL('clientRedirect/a.html') }},
+ { label: "a-onDOMContentLoaded",
+ event: "onDOMContentLoaded",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('clientRedirect/a.html') }},
+ { label: "a-onCompleted",
+ event: "onCompleted",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('clientRedirect/a.html') }},
+ { label: "b-onBeforeNavigate",
+ event: "onBeforeNavigate",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('clientRedirect/b.html') }},
+ { label: "b-onCommitted",
+ event: "onCommitted",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ transitionQualifiers: ["client_redirect"],
+ transitionType: "link",
+ url: getURL('clientRedirect/b.html') }},
+ { label: "b-onDOMContentLoaded",
+ event: "onDOMContentLoaded",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('clientRedirect/b.html') }},
+ { label: "b-onCompleted",
+ event: "onCompleted",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('clientRedirect/b.html') }}],
+ [ navigationOrder("a-"),
+ navigationOrder("b-"),
+ isLoadedBy("b-", "a-") ]);
chrome.tabs.update(tabId, { url: getURL('clientRedirect/a.html') });
},
]);
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_failures.js b/chrome/test/data/extensions/api_test/webnavigation/test_failures.js
index fedb59e..5f61510 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_failures.js
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_failures.js
@@ -11,117 +11,144 @@ function runTests() {
// Navigates to a non-existant page.
function nonExistant() {
expect([
- [ "onBeforeNavigate",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('failures/nonexistant.html') }],
- [ "onErrorOccurred",
- { error: "net::ERR_FILE_NOT_FOUND",
- frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('failures/nonexistant.html') }]]);
+ { label: "onBeforeNavigate",
+ event: "onBeforeNavigate",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('failures/nonexistant.html') }},
+ { label: "onErrorOccurred",
+ event: "onErrorOccurred",
+ details: { error: "net::ERR_FILE_NOT_FOUND",
+ frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('failures/nonexistant.html') }}],
+ [["onBeforeNavigate", "onErrorOccurred"]]);
chrome.tabs.update(tabId, { url: getURL('failures/nonexistant.html') });
},
// An page that tries to load an non-existant iframe.
function nonExistantIframe() {
expect([
- [ "onBeforeNavigate",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('failures/d.html') }],
- [ "onCommitted",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- transitionQualifiers: [],
- transitionType: "link",
- url: getURL('failures/d.html') }],
- [ "onBeforeNavigate",
- { frameId: 1,
- tabId: 0,
- timeStamp: 0,
- url: getURL('failures/c.html') }],
- [ "onDOMContentLoaded",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('failures/d.html') }],
- [ "onErrorOccurred",
- { error: "net::ERR_FILE_NOT_FOUND",
- frameId: 1,
- tabId: 0,
- timeStamp: 0,
- url: getURL('failures/c.html') }],
- [ "onCompleted",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('failures/d.html') }]]);
+ { label: "a-onBeforeNavigate",
+ event: "onBeforeNavigate",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('failures/d.html') }},
+ { label: "a-onCommitted",
+ event: "onCommitted",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ transitionQualifiers: [],
+ transitionType: "link",
+ url: getURL('failures/d.html') }},
+ { label: "a-onDOMContentLoaded",
+ event: "onDOMContentLoaded",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('failures/d.html') }},
+ { label: "a-onCompleted",
+ event: "onCompleted",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('failures/d.html') }},
+ { label: "b-onBeforeNavigate",
+ event: "onBeforeNavigate",
+ details: { frameId: 1,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('failures/c.html') }},
+ { label: "b-onErrorOccurred",
+ event: "onErrorOccurred",
+ details: { error: "net::ERR_FILE_NOT_FOUND",
+ frameId: 1,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('failures/c.html') }}],
+ [navigationOrder("a-"),
+ ["a-onCommitted", "b-onBeforeNavigate", "b-onErrorOccurred",
+ "a-onCompleted"]]);
chrome.tabs.update(tabId, { url: getURL('failures/d.html') });
},
// An iframe navigates to a non-existant page.
function nonExistantIframeNavigation() {
expect([
- [ "onBeforeNavigate",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('failures/a.html') }],
- [ "onCommitted",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- transitionQualifiers: [],
- transitionType: "link",
- url: getURL('failures/a.html') }],
- [ "onBeforeNavigate",
- { frameId: 1,
- tabId: 0,
- timeStamp: 0,
- url: getURL('failures/b.html') }],
- [ "onDOMContentLoaded",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('failures/a.html') }],
- [ "onCommitted",
- { frameId: 1,
- tabId: 0,
- timeStamp: 0,
- transitionQualifiers: [],
- transitionType: "auto_subframe",
- url: getURL('failures/b.html') }],
- [ "onDOMContentLoaded",
- { frameId: 1,
- tabId: 0,
- timeStamp: 0,
- url: getURL('failures/b.html') }],
- [ "onCompleted",
- { frameId: 1,
- tabId: 0,
- timeStamp: 0,
- url: getURL('failures/b.html') }],
- [ "onCompleted",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('failures/a.html') }],
- [ "onBeforeNavigate",
- { frameId: 1,
- tabId: 0,
- timeStamp: 0,
- url: getURL('failures/c.html') }],
- [ "onErrorOccurred",
- { error: "net::ERR_FILE_NOT_FOUND",
- frameId: 1,
- tabId: 0,
- timeStamp: 0,
- url: getURL('failures/c.html') }]]);
+ { label: "a-onBeforeNavigate",
+ event: "onBeforeNavigate",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('failures/a.html') }},
+ { label: "a-onCommitted",
+ event: "onCommitted",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ transitionQualifiers: [],
+ transitionType: "link",
+ url: getURL('failures/a.html') }},
+ { label: "a-onDOMContentLoaded",
+ event: "onDOMContentLoaded",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('failures/a.html') }},
+ { label: "a-onCompleted",
+ event: "onCompleted",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('failures/a.html') }},
+ { label: "b-onBeforeNavigate",
+ event: "onBeforeNavigate",
+ details: { frameId: 1,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('failures/b.html') }},
+ { label: "b-onCommitted",
+ event: "onCommitted",
+ details: { frameId: 1,
+ tabId: 0,
+ timeStamp: 0,
+ transitionQualifiers: [],
+ transitionType: "auto_subframe",
+ url: getURL('failures/b.html') }},
+ { label: "b-onDOMContentLoaded",
+ event: "onDOMContentLoaded",
+ details: { frameId: 1,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('failures/b.html') }},
+ { label: "b-onCompleted",
+ event: "onCompleted",
+ details: { frameId: 1,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('failures/b.html') }},
+ { label: "c-onBeforeNavigate",
+ event: "onBeforeNavigate",
+ details: { frameId: 1,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('failures/c.html') }},
+ { label: "c-onErrorOccurred",
+ event: "onErrorOccurred",
+ details: { error: "net::ERR_FILE_NOT_FOUND",
+ frameId: 1,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('failures/c.html') }}],
+ [ navigationOrder("a-"),
+ navigationOrder("b-"),
+ isIFrameOf("b-", "a-"),
+ isLoadedBy("c-", "b-"),
+ ["c-onBeforeNavigate", "c-onErrorOccurred"]]);
chrome.tabs.update(tabId, { url: getURL('failures/a.html') });
},
]);
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_forwardBack.js b/chrome/test/data/extensions/api_test/webnavigation/test_forwardBack.js
index 8f22930..7e6f8f1 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_forwardBack.js
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_forwardBack.js
@@ -12,72 +12,86 @@ function runTests() {
// history.back() to navigate back to a.html
function forwardBack() {
expect([
- [ "onBeforeNavigate",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('forwardBack/a.html') }],
- [ "onCommitted",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- transitionQualifiers: [],
- transitionType: "link",
- url: getURL('forwardBack/a.html') }],
- [ "onDOMContentLoaded",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('forwardBack/a.html') }],
- [ "onCompleted",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('forwardBack/a.html') }],
- [ "onBeforeNavigate",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('forwardBack/b.html') }],
- [ "onCommitted",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- transitionQualifiers: ["client_redirect"],
- transitionType: "link",
- url: getURL('forwardBack/b.html') }],
- [ "onDOMContentLoaded",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('forwardBack/b.html') }],
- [ "onCompleted",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('forwardBack/b.html') }],
- [ "onBeforeNavigate",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('forwardBack/a.html') }],
- [ "onCommitted",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- transitionQualifiers: ["forward_back"],
- transitionType: "link",
- url: getURL('forwardBack/a.html') }],
- [ "onDOMContentLoaded",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('forwardBack/a.html') }],
- [ "onCompleted",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('forwardBack/a.html') }]]);
+ { label: "a-onBeforeNavigate",
+ event: "onBeforeNavigate",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('forwardBack/a.html') }},
+ { label: "a-onCommitted",
+ event: "onCommitted",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ transitionQualifiers: [],
+ transitionType: "link",
+ url: getURL('forwardBack/a.html') }},
+ { label: "a-onDOMContentLoaded",
+ event: "onDOMContentLoaded",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('forwardBack/a.html') }},
+ { label: "a-onCompleted",
+ event: "onCompleted",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('forwardBack/a.html') }},
+ { label: "b-onBeforeNavigate",
+ event: "onBeforeNavigate",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('forwardBack/b.html') }},
+ { label: "b-onCommitted",
+ event: "onCommitted",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ transitionQualifiers: ["client_redirect"],
+ transitionType: "link",
+ url: getURL('forwardBack/b.html') }},
+ { label: "b-onDOMContentLoaded",
+ event: "onDOMContentLoaded",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('forwardBack/b.html') }},
+ { label: "b-onCompleted",
+ event: "onCompleted",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('forwardBack/b.html') }},
+ { label: "c-onBeforeNavigate",
+ event: "onBeforeNavigate",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('forwardBack/a.html') }},
+ { label: "c-onCommitted",
+ event: "onCommitted",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ transitionQualifiers: ["forward_back"],
+ transitionType: "link",
+ url: getURL('forwardBack/a.html') }},
+ { label: "c-onDOMContentLoaded",
+ event: "onDOMContentLoaded",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('forwardBack/a.html') }},
+ { label: "c-onCompleted",
+ event: "onCompleted",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('forwardBack/a.html') }}],
+ [ navigationOrder("a-"), navigationOrder("b-"), navigationOrder("c-"),
+ isLoadedBy("b-", "a-"), isLoadedBy("c-", "b-")]);
chrome.tabs.update(tabId, { url: getURL('forwardBack/a.html') });
},
]);
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_iframe.js b/chrome/test/data/extensions/api_test/webnavigation/test_iframe.js
index e33a6ac..58e61c8 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_iframe.js
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_iframe.js
@@ -12,72 +12,89 @@ function runTests() {
// redirects to c.html.
function iframe() {
expect([
- [ "onBeforeNavigate",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('iframe/a.html') }],
- [ "onCommitted",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- transitionQualifiers: [],
- transitionType: "link",
- url: getURL('iframe/a.html') }],
- [ "onBeforeNavigate",
- { frameId: 1,
- tabId: 0,
- timeStamp: 0,
- url: getURL('iframe/b.html') }],
- [ "onDOMContentLoaded",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('iframe/a.html') }],
- [ "onCommitted",
- { frameId: 1,
- tabId: 0,
- timeStamp: 0,
- transitionQualifiers: [],
- transitionType: "auto_subframe",
- url: getURL('iframe/b.html') }],
- [ "onDOMContentLoaded",
- { frameId: 1,
- tabId: 0,
- timeStamp: 0,
- url: getURL('iframe/b.html') }],
- [ "onCompleted",
- { frameId: 1,
- tabId: 0,
- timeStamp: 0,
- url: getURL('iframe/b.html') }],
- [ "onCompleted",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('iframe/a.html') }],
- [ "onBeforeNavigate",
- { frameId: 1,
- tabId: 0,
- timeStamp: 0,
- url: getURL('iframe/c.html') }],
- [ "onCommitted",
- { frameId: 1,
- tabId: 0,
- timeStamp: 0,
- transitionQualifiers: [],
- transitionType: "manual_subframe",
- url: getURL('iframe/c.html') }],
- [ "onDOMContentLoaded",
- { frameId: 1,
- tabId: 0,
- timeStamp: 0,
- url: getURL('iframe/c.html') }],
- [ "onCompleted",
- { frameId: 1,
- tabId: 0,
- timeStamp: 0,
- url: getURL('iframe/c.html') }]]);
+ { label: "a-onBeforeNavigate",
+ event: "onBeforeNavigate",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('iframe/a.html') }},
+ { label: "a-onCommitted",
+ event: "onCommitted",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ transitionQualifiers: [],
+ transitionType: "link",
+ url: getURL('iframe/a.html') }},
+ { label: "a-onDOMContentLoaded",
+ event: "onDOMContentLoaded",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('iframe/a.html') }},
+ { label: "a-onCompleted",
+ event: "onCompleted",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('iframe/a.html') }},
+ { label: "b-onBeforeNavigate",
+ event: "onBeforeNavigate",
+ details: { frameId: 1,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('iframe/b.html') }},
+ { label: "b-onCommitted",
+ event: "onCommitted",
+ details: { frameId: 1,
+ tabId: 0,
+ timeStamp: 0,
+ transitionQualifiers: [],
+ transitionType: "auto_subframe",
+ url: getURL('iframe/b.html') }},
+ { label: "b-onDOMContentLoaded",
+ event: "onDOMContentLoaded",
+ details: { frameId: 1,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('iframe/b.html') }},
+ { label: "b-onCompleted",
+ event: "onCompleted",
+ details: { frameId: 1,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('iframe/b.html') }},
+ { label: "c-onBeforeNavigate",
+ event: "onBeforeNavigate",
+ details: { frameId: 1,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('iframe/c.html') }},
+ { label: "c-onCommitted",
+ event: "onCommitted",
+ details: { frameId: 1,
+ tabId: 0,
+ timeStamp: 0,
+ transitionQualifiers: [],
+ transitionType: "auto_subframe",
+ url: getURL('iframe/c.html') }},
+ { label: "c-onDOMContentLoaded",
+ event: "onDOMContentLoaded",
+ details: { frameId: 1,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('iframe/c.html') }},
+ { label: "c-onCompleted",
+ event: "onCompleted",
+ details: { frameId: 1,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('iframe/c.html') }}],
+ [ navigationOrder("a-"),
+ navigationOrder("b-"),
+ navigationOrder("c-"),
+ isIFrameOf("b-", "a-"),
+ isLoadedBy("c-", "b-")]);
chrome.tabs.update(tabId, { url: getURL('iframe/a.html') });
},
@@ -86,94 +103,118 @@ function runTests() {
// created by javascript. f.html then navigates to g.html.
function iframeMultiple() {
expect([
- [ "onBeforeNavigate",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('iframe/d.html') }],
- [ "onCommitted",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- transitionQualifiers: [],
- transitionType: "link",
- url: getURL('iframe/d.html') }],
- [ "onBeforeNavigate",
- { frameId: 1,
- tabId: 0,
- timeStamp: 0,
- url: getURL('iframe/e.html') }],
- [ "onDOMContentLoaded",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('iframe/d.html') }],
- [ "onCommitted",
- { frameId: 1,
- tabId: 0,
- timeStamp: 0,
- transitionQualifiers: [],
- transitionType: "auto_subframe",
- url: getURL('iframe/e.html') }],
- [ "onDOMContentLoaded",
- { frameId: 1,
- tabId: 0,
- timeStamp: 0,
- url: getURL('iframe/e.html') }],
- [ "onBeforeNavigate",
- { frameId: 2,
- tabId: 0,
- timeStamp: 0,
- url: getURL('iframe/f.html') }],
- [ "onCompleted",
- { frameId: 1,
- tabId: 0,
- timeStamp: 0,
- url: getURL('iframe/e.html') }],
- [ "onCommitted",
- { frameId: 2,
- tabId: 0,
- timeStamp: 0,
- transitionQualifiers: [],
- transitionType: "auto_subframe",
- url: getURL('iframe/f.html') }],
- [ "onDOMContentLoaded",
- { frameId: 2,
- tabId: 0,
- timeStamp: 0,
- url: getURL('iframe/f.html') }],
- [ "onCompleted",
- { frameId: 2,
- tabId: 0,
- timeStamp: 0,
- url: getURL('iframe/f.html') }],
- [ "onCompleted",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('iframe/d.html') }],
- [ "onBeforeNavigate",
- { frameId: 2,
- tabId: 0,
- timeStamp: 0,
- url: getURL('iframe/g.html') }],
- [ "onCommitted",
- { frameId: 2,
- tabId: 0,
- timeStamp: 0,
- transitionQualifiers: [],
- transitionType: "manual_subframe",
- url: getURL('iframe/g.html') }],
- [ "onDOMContentLoaded",
- { frameId: 2,
- tabId: 0,
- timeStamp: 0,
- url: getURL('iframe/g.html') }],
- [ "onCompleted",
- { frameId: 2,
- tabId: 0,
- timeStamp: 0,
- url: getURL('iframe/g.html') }]]);
+ { label: "d-onBeforeNavigate",
+ event: "onBeforeNavigate",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('iframe/d.html') }},
+ { label: "d-onCommitted",
+ event: "onCommitted",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ transitionQualifiers: [],
+ transitionType: "link",
+ url: getURL('iframe/d.html') }},
+ { label: "d-onDOMContentLoaded",
+ event: "onDOMContentLoaded",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('iframe/d.html') }},
+ { label: "d-onCompleted",
+ event: "onCompleted",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('iframe/d.html') }},
+ { label: "e-onBeforeNavigate",
+ event: "onBeforeNavigate",
+ details: { frameId: 1,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('iframe/e.html') }},
+ { label: "e-onCommitted",
+ event: "onCommitted",
+ details: { frameId: 1,
+ tabId: 0,
+ timeStamp: 0,
+ transitionQualifiers: [],
+ transitionType: "auto_subframe",
+ url: getURL('iframe/e.html') }},
+ { label: "e-onDOMContentLoaded",
+ event: "onDOMContentLoaded",
+ details: { frameId: 1,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('iframe/e.html') }},
+ { label: "e-onCompleted",
+ event: "onCompleted",
+ details: { frameId: 1,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('iframe/e.html') }},
+ { label: "f-onBeforeNavigate",
+ event: "onBeforeNavigate",
+ details: { frameId: 2,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('iframe/f.html') }},
+ { label: "f-onCommitted",
+ event: "onCommitted",
+ details: { frameId: 2,
+ tabId: 0,
+ timeStamp: 0,
+ transitionQualifiers: [],
+ transitionType: "auto_subframe",
+ url: getURL('iframe/f.html') }},
+ { label: "f-onDOMContentLoaded",
+ event: "onDOMContentLoaded",
+ details: { frameId: 2,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('iframe/f.html') }},
+ { label: "f-onCompleted",
+ event: "onCompleted",
+ details: { frameId: 2,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('iframe/f.html') }},
+ { label: "g-onBeforeNavigate",
+ event: "onBeforeNavigate",
+ details: { frameId: 2,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('iframe/g.html') }},
+ { label: "g-onCommitted",
+ event: "onCommitted",
+ details: { frameId: 2,
+ tabId: 0,
+ timeStamp: 0,
+ transitionQualifiers: [],
+ transitionType: "auto_subframe",
+ url: getURL('iframe/g.html') }},
+ { label: "g-onDOMContentLoaded",
+ event: "onDOMContentLoaded",
+ details: { frameId: 2,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('iframe/g.html') }},
+ { label: "g-onCompleted",
+ event: "onCompleted",
+ details: { frameId: 2,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('iframe/g.html') }}],
+ [ navigationOrder("d-"),
+ navigationOrder("e-"),
+ navigationOrder("f-"),
+ navigationOrder("g-"),
+ isIFrameOf("e-", "d-"),
+ ["d-onDOMContentLoaded", "f-onBeforeNavigate", "f-onCompleted",
+ "d-onCompleted"],
+ isLoadedBy("g-", "f-")]);
chrome.tabs.update(tabId, { url: getURL('iframe/d.html') });
},
@@ -181,72 +222,89 @@ function runTests() {
// on the main frame.
function iframeNavigate() {
expect([
- [ "onBeforeNavigate",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('iframe/h.html') }],
- [ "onCommitted",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- transitionQualifiers: [],
- transitionType: "link",
- url: getURL('iframe/h.html') }],
- [ "onBeforeNavigate",
- { frameId: 1,
- tabId: 0,
- timeStamp: 0,
- url: getURL('iframe/i.html') }],
- [ "onDOMContentLoaded",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('iframe/h.html') }],
- [ "onCommitted",
- { frameId: 1,
- tabId: 0,
- timeStamp: 0,
- transitionQualifiers: [],
- transitionType: "auto_subframe",
- url: getURL('iframe/i.html') }],
- [ "onDOMContentLoaded",
- { frameId: 1,
- tabId: 0,
- timeStamp: 0,
- url: getURL('iframe/i.html') }],
- [ "onCompleted",
- { frameId: 1,
- tabId: 0,
- timeStamp: 0,
- url: getURL('iframe/i.html') }],
- [ "onCompleted",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('iframe/h.html') }],
- [ "onBeforeNavigate",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('iframe/c.html') }],
- [ "onCommitted",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- transitionQualifiers: [],
- transitionType: "link",
- url: getURL('iframe/c.html') }],
- [ "onDOMContentLoaded",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('iframe/c.html') }],
- [ "onCompleted",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('iframe/c.html') }]]);
+ { label: "h-onBeforeNavigate",
+ event: "onBeforeNavigate",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('iframe/h.html') }},
+ { label: "h-onCommitted",
+ event: "onCommitted",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ transitionQualifiers: [],
+ transitionType: "link",
+ url: getURL('iframe/h.html') }},
+ { label: "h-onDOMContentLoaded",
+ event: "onDOMContentLoaded",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('iframe/h.html') }},
+ { label: "h-onCompleted",
+ event: "onCompleted",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('iframe/h.html') }},
+ { label: "i-onBeforeNavigate",
+ event: "onBeforeNavigate",
+ details: { frameId: 1,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('iframe/i.html') }},
+ { label: "i-onCommitted",
+ event: "onCommitted",
+ details: { frameId: 1,
+ tabId: 0,
+ timeStamp: 0,
+ transitionQualifiers: [],
+ transitionType: "auto_subframe",
+ url: getURL('iframe/i.html') }},
+ { label: "i-onDOMContentLoaded",
+ event: "onDOMContentLoaded",
+ details: { frameId: 1,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('iframe/i.html') }},
+ { label: "i-onCompleted",
+ event: "onCompleted",
+ details: { frameId: 1,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('iframe/i.html') }},
+ { label: "c-onBeforeNavigate",
+ event: "onBeforeNavigate",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('iframe/c.html') }},
+ { label: "c-onCommitted",
+ event: "onCommitted",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ transitionQualifiers: [],
+ transitionType: "link",
+ url: getURL('iframe/c.html') }},
+ { label: "c-onDOMContentLoaded",
+ event: "onDOMContentLoaded",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('iframe/c.html') }},
+ { label: "c-onCompleted",
+ event: "onCompleted",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('iframe/c.html') }}],
+ [ navigationOrder("h-"),
+ navigationOrder("i-"),
+ navigationOrder("c-"),
+ isIFrameOf("i-", "h-"),
+ isLoadedBy("c-", "i-") ]);
chrome.tabs.update(tabId, { url: getURL('iframe/h.html') });
},
]);
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 2f4e5a4..5b33110 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') });
},
]);
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_referenceFragment.js b/chrome/test/data/extensions/api_test/webnavigation/test_referenceFragment.js
index 06e9f22..96a5a71 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_referenceFragment.js
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_referenceFragment.js
@@ -11,35 +11,41 @@ function runTests() {
// Reference fragment navigation.
function referenceFragment() {
expect([
- [ "onBeforeNavigate",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('referenceFragment/a.html') }],
- [ "onCommitted",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- transitionQualifiers: [],
- transitionType: "link",
- url: getURL('referenceFragment/a.html') }],
- [ "onDOMContentLoaded",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('referenceFragment/a.html') }],
- [ "onCompleted",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('referenceFragment/a.html') }],
- [ "onReferenceFragmentUpdated",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- transitionQualifiers: ["client_redirect"],
- transitionType: "link",
- url: getURL('referenceFragment/a.html#anchor') }]]);
+ { label: "a-onBeforeNavigate",
+ event: "onBeforeNavigate",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('referenceFragment/a.html') }},
+ { label: "a-onCommitted",
+ event: "onCommitted",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ transitionQualifiers: [],
+ transitionType: "link",
+ url: getURL('referenceFragment/a.html') }},
+ { label: "a-onDOMContentLoaded",
+ event: "onDOMContentLoaded",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('referenceFragment/a.html') }},
+ { label: "a-onCompleted",
+ event: "onCompleted",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('referenceFragment/a.html#anchor') }},
+ { label: "a-onReferenceFragmentUpdated",
+ event: "onReferenceFragmentUpdated",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ transitionQualifiers: ["client_redirect"],
+ transitionType: "link",
+ url: getURL('referenceFragment/a.html#anchor') }}],
+ [ navigationOrder("a-") ]);
chrome.tabs.update(tabId, { url: getURL('referenceFragment/a.html') });
},
]);
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_serverRedirect.js b/chrome/test/data/extensions/api_test/webnavigation/test_serverRedirect.js
index 96502ce..026f2b6 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_serverRedirect.js
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_serverRedirect.js
@@ -4,7 +4,8 @@
function runTests() {
var getURL = chrome.extension.getURL;
- var URL_LOAD = "http://www.a.com:PORT/files/extensions/api_test/webnavigation/serverRedirect/a.html";
+ var URL_LOAD =
+ "http://www.a.com:PORT/files/extensions/api_test/webnavigation/serverRedirect/a.html";
var URL_LOAD_REDIRECT = "http://www.a.com:PORT/server-redirect?" + URL_LOAD;
chrome.tabs.create({"url": "about:blank"}, function(tab) {
var tabId = tab.id;
@@ -18,28 +19,33 @@ function runTests() {
// Navigates to a page that redirects (on the server side) to a.html.
function serverRedirect() {
expect([
- [ "onBeforeNavigate",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: URL_LOAD_REDIRECT }],
- [ "onCommitted",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- transitionQualifiers: [],
- transitionType: "link",
- url: URL_LOAD }],
- [ "onDOMContentLoaded",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: URL_LOAD }],
- [ "onCompleted",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: URL_LOAD }]]);
+ { label: "a-onBeforeNavigate",
+ event: "onBeforeNavigate",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: URL_LOAD_REDIRECT }},
+ { label: "a-onCommitted",
+ event: "onCommitted",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ transitionQualifiers: [],
+ transitionType: "link",
+ url: URL_LOAD }},
+ { label: "a-onDOMContentLoaded",
+ event: "onDOMContentLoaded",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: URL_LOAD }},
+ { label: "a-onCompleted",
+ event: "onCompleted",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: URL_LOAD }}],
+ [ navigationOrder("a-") ]);
chrome.tabs.update(tabId, { url: URL_LOAD_REDIRECT });
},
]);
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_simpleLoad.js b/chrome/test/data/extensions/api_test/webnavigation/test_simpleLoad.js
index 57ef2402..a40f8f1 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_simpleLoad.js
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_simpleLoad.js
@@ -11,28 +11,33 @@ function runTests() {
// Navigates to an URL.
function simpleLoad() {
expect([
- [ "onBeforeNavigate",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('simpleLoad/a.html') }],
- [ "onCommitted",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- transitionQualifiers: [],
- transitionType: "link",
- url: getURL('simpleLoad/a.html') }],
- [ "onDOMContentLoaded",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('simpleLoad/a.html') }],
- [ "onCompleted",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('simpleLoad/a.html') }]]);
+ { label: "a-onBeforeNavigate",
+ event: "onBeforeNavigate",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('simpleLoad/a.html') }},
+ { label: "a-onCommitted",
+ event: "onCommitted",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ transitionQualifiers: [],
+ transitionType: "link",
+ url: getURL('simpleLoad/a.html') }},
+ { label: "a-onDOMContentLoaded",
+ event: "onDOMContentLoaded",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('simpleLoad/a.html') }},
+ { label: "a-onCompleted",
+ event: "onCompleted",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('simpleLoad/a.html') }}],
+ [ navigationOrder("a-") ]);
chrome.tabs.update(tabId, { url: getURL('simpleLoad/a.html') });
},
]);
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_userAction.js b/chrome/test/data/extensions/api_test/webnavigation/test_userAction.js
index 7c2d09c..6f80aa2 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_userAction.js
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_userAction.js
@@ -11,56 +11,70 @@ function runTests() {
// Opens a tab and waits for the user to click on a link in it.
function userAction() {
expect([
- [ "onBeforeNavigate",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('userAction/a.html') }],
- [ "onCommitted",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- transitionQualifiers: [],
- transitionType: "typed",
- url: getURL('userAction/a.html') }],
- [ "onDOMContentLoaded",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('userAction/a.html') }],
- [ "onCompleted",
- { frameId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('userAction/a.html') }],
- [ "onCreatedNavigationTarget",
- { sourceFrameId: 0,
- sourceTabId: 0,
- tabId: 1,
- timeStamp: 0,
- url: getURL('userAction/b.html') }],
- [ "onBeforeNavigate",
- { frameId: 0,
- tabId: 1,
- timeStamp: 0,
- url: getURL('userAction/b.html') }],
- [ "onCommitted",
- { frameId: 0,
- tabId: 1,
- timeStamp: 0,
- transitionQualifiers: [],
- transitionType: "link",
- url: getURL('userAction/b.html') }],
- [ "onDOMContentLoaded",
- { frameId: 0,
- tabId: 1,
- timeStamp: 0,
- url: getURL('userAction/b.html') }],
- [ "onCompleted",
- { frameId: 0,
- tabId: 1,
- timeStamp: 0,
- url: getURL('userAction/b.html') }]]);
+ { label: "a-onBeforeNavigate",
+ event: "onBeforeNavigate",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('userAction/a.html') }},
+ { label: "a-onCommitted",
+ event: "onCommitted",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ transitionQualifiers: [],
+ transitionType: "typed",
+ url: getURL('userAction/a.html') }},
+ { label: "a-onDOMContentLoaded",
+ event: "onDOMContentLoaded",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('userAction/a.html') }},
+ { label: "a-onCompleted",
+ event: "onCompleted",
+ details: { frameId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('userAction/a.html') }},
+ { label: "b-onCreatedNavigationTarget",
+ event: "onCreatedNavigationTarget",
+ details: { sourceFrameId: 0,
+ sourceTabId: 0,
+ tabId: 1,
+ timeStamp: 0,
+ url: getURL('userAction/b.html') }},
+ { label: "b-onBeforeNavigate",
+ event: "onBeforeNavigate",
+ details: { frameId: 0,
+ tabId: 1,
+ timeStamp: 0,
+ url: getURL('userAction/b.html') }},
+ { label: "b-onCommitted",
+ event: "onCommitted",
+ details: { frameId: 0,
+ tabId: 1,
+ timeStamp: 0,
+ transitionQualifiers: [],
+ transitionType: "link",
+ url: getURL('userAction/b.html') }},
+ { label: "b-onDOMContentLoaded",
+ event: "onDOMContentLoaded",
+ details: { frameId: 0,
+ tabId: 1,
+ timeStamp: 0,
+ url: getURL('userAction/b.html') }},
+ { label: "b-onCompleted",
+ event: "onCompleted",
+ details: { frameId: 0,
+ tabId: 1,
+ timeStamp: 0,
+ url: getURL('userAction/b.html') }}],
+ [ navigationOrder("a-"),
+ navigationOrder("b-"),
+ [ "a-onDOMContentLoaded",
+ "b-onCreatedNavigationTarget",
+ "b-onBeforeNavigate" ]]);
// Notify the api test that we're waiting for the user.
chrome.test.notifyPass();