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

Side by Side Diff: chrome/test/data/extensions/api_test/webnavigation/test_history.js

Issue 10704225: Send an webNavigation event for navigations triggered by window.history (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 function runTests() { 5 function runTests() {
6 var getURL = chrome.extension.getURL; 6 var getURL = chrome.extension.getURL;
7 chrome.tabs.create({"url": "about:blank"}, function(tab) { 7 chrome.tabs.create({"url": "about:blank"}, function(tab) {
8 var tabId = tab.id; 8 var tabId = tab.id;
9 9
10 chrome.test.runTests([ 10 chrome.test.runTests([
11 // Reference fragment navigation. 11 // History manipulation via window.history
12 function referenceFragment() { 12 function history() {
13 expect([ 13 expect([
14 { label: "a-onBeforeNavigate", 14 { label: "a-onBeforeNavigate",
15 event: "onBeforeNavigate", 15 event: "onBeforeNavigate",
16 details: { frameId: 0, 16 details: { frameId: 0,
17 tabId: 0, 17 tabId: 0,
18 timeStamp: 0, 18 timeStamp: 0,
19 url: getURL('referenceFragment/a.html') }}, 19 url: getURL('history/a.html') }},
20 { label: "a-onCommitted", 20 { label: "a-onCommitted",
21 event: "onCommitted", 21 event: "onCommitted",
22 details: { frameId: 0, 22 details: { frameId: 0,
23 tabId: 0, 23 tabId: 0,
24 timeStamp: 0, 24 timeStamp: 0,
25 transitionQualifiers: [], 25 transitionQualifiers: [],
26 transitionType: "link", 26 transitionType: "link",
27 url: getURL('referenceFragment/a.html') }}, 27 url: getURL('history/a.html') }},
28 { label: "a-onDOMContentLoaded", 28 { label: "a-onDOMContentLoaded",
29 event: "onDOMContentLoaded", 29 event: "onDOMContentLoaded",
30 details: { frameId: 0, 30 details: { frameId: 0,
31 tabId: 0, 31 tabId: 0,
32 timeStamp: 0, 32 timeStamp: 0,
33 url: getURL('referenceFragment/a.html') }}, 33 url: getURL('history/a.html') }},
34 { label: "a-onCompleted", 34 { label: "a-onCompleted",
35 event: "onCompleted", 35 event: "onCompleted",
36 details: { frameId: 0, 36 details: { frameId: 0,
37 tabId: 0, 37 tabId: 0,
38 timeStamp: 0, 38 timeStamp: 0,
39 url: getURL('referenceFragment/a.html#anchor') }}, 39 url: getURL('history/b.html') }},
40 { label: "a-onReferenceFragmentUpdated", 40 { label: "a-onHistoryStateUpdated",
41 event: "onReferenceFragmentUpdated", 41 event: "onHistoryStateUpdated",
42 details: { frameId: 0, 42 details: { frameId: 0,
43 tabId: 0, 43 tabId: 0,
44 timeStamp: 0, 44 timeStamp: 0,
45 transitionQualifiers: ["client_redirect"], 45 transitionQualifiers: ["client_redirect"],
46 transitionType: "link", 46 transitionType: "link",
47 url: getURL('referenceFragment/a.html#anchor') }}], 47 url: getURL('history/b.html') }}],
48 [ navigationOrder("a-") ]); 48 [ navigationOrder("a-") ]);
49 chrome.tabs.update(tabId, { url: getURL('referenceFragment/a.html') }); 49 chrome.tabs.update(tabId, { url: getURL('history/a.html') });
50 }, 50 },
51 ]); 51 ]);
52 }); 52 });
53 } 53 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698