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

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

Issue 10815051: Send the correct process ID with webNavigation events (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) 2011 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 // First navigates to a.html which redirects to to b.html which uses 11 // First navigates to a.html which redirects to to b.html which uses
12 // history.back() to navigate back to a.html 12 // history.back() to navigate back to a.html
13 function forwardBack() { 13 function forwardBack() {
14 expect([ 14 expect([
15 { label: "a-onBeforeNavigate", 15 { label: "a-onBeforeNavigate",
16 event: "onBeforeNavigate", 16 event: "onBeforeNavigate",
17 details: { frameId: 0, 17 details: { frameId: 0,
18 processId: 0,
18 tabId: 0, 19 tabId: 0,
19 timeStamp: 0, 20 timeStamp: 0,
20 url: getURL('forwardBack/a.html') }}, 21 url: getURL('forwardBack/a.html') }},
21 { label: "a-onCommitted", 22 { label: "a-onCommitted",
22 event: "onCommitted", 23 event: "onCommitted",
23 details: { frameId: 0, 24 details: { frameId: 0,
25 processId: 0,
24 tabId: 0, 26 tabId: 0,
25 timeStamp: 0, 27 timeStamp: 0,
26 transitionQualifiers: [], 28 transitionQualifiers: [],
27 transitionType: "link", 29 transitionType: "link",
28 url: getURL('forwardBack/a.html') }}, 30 url: getURL('forwardBack/a.html') }},
29 { label: "a-onDOMContentLoaded", 31 { label: "a-onDOMContentLoaded",
30 event: "onDOMContentLoaded", 32 event: "onDOMContentLoaded",
31 details: { frameId: 0, 33 details: { frameId: 0,
34 processId: 0,
32 tabId: 0, 35 tabId: 0,
33 timeStamp: 0, 36 timeStamp: 0,
34 url: getURL('forwardBack/a.html') }}, 37 url: getURL('forwardBack/a.html') }},
35 { label: "a-onCompleted", 38 { label: "a-onCompleted",
36 event: "onCompleted", 39 event: "onCompleted",
37 details: { frameId: 0, 40 details: { frameId: 0,
41 processId: 0,
38 tabId: 0, 42 tabId: 0,
39 timeStamp: 0, 43 timeStamp: 0,
40 url: getURL('forwardBack/a.html') }}, 44 url: getURL('forwardBack/a.html') }},
41 { label: "b-onBeforeNavigate", 45 { label: "b-onBeforeNavigate",
42 event: "onBeforeNavigate", 46 event: "onBeforeNavigate",
43 details: { frameId: 0, 47 details: { frameId: 0,
48 processId: 0,
44 tabId: 0, 49 tabId: 0,
45 timeStamp: 0, 50 timeStamp: 0,
46 url: getURL('forwardBack/b.html') }}, 51 url: getURL('forwardBack/b.html') }},
47 { label: "b-onCommitted", 52 { label: "b-onCommitted",
48 event: "onCommitted", 53 event: "onCommitted",
49 details: { frameId: 0, 54 details: { frameId: 0,
55 processId: 0,
50 tabId: 0, 56 tabId: 0,
51 timeStamp: 0, 57 timeStamp: 0,
52 transitionQualifiers: ["client_redirect"], 58 transitionQualifiers: ["client_redirect"],
53 transitionType: "link", 59 transitionType: "link",
54 url: getURL('forwardBack/b.html') }}, 60 url: getURL('forwardBack/b.html') }},
55 { label: "b-onDOMContentLoaded", 61 { label: "b-onDOMContentLoaded",
56 event: "onDOMContentLoaded", 62 event: "onDOMContentLoaded",
57 details: { frameId: 0, 63 details: { frameId: 0,
64 processId: 0,
58 tabId: 0, 65 tabId: 0,
59 timeStamp: 0, 66 timeStamp: 0,
60 url: getURL('forwardBack/b.html') }}, 67 url: getURL('forwardBack/b.html') }},
61 { label: "b-onCompleted", 68 { label: "b-onCompleted",
62 event: "onCompleted", 69 event: "onCompleted",
63 details: { frameId: 0, 70 details: { frameId: 0,
71 processId: 0,
64 tabId: 0, 72 tabId: 0,
65 timeStamp: 0, 73 timeStamp: 0,
66 url: getURL('forwardBack/b.html') }}, 74 url: getURL('forwardBack/b.html') }},
67 { label: "c-onBeforeNavigate", 75 { label: "c-onBeforeNavigate",
68 event: "onBeforeNavigate", 76 event: "onBeforeNavigate",
69 details: { frameId: 0, 77 details: { frameId: 0,
78 processId: 0,
70 tabId: 0, 79 tabId: 0,
71 timeStamp: 0, 80 timeStamp: 0,
72 url: getURL('forwardBack/a.html') }}, 81 url: getURL('forwardBack/a.html') }},
73 { label: "c-onCommitted", 82 { label: "c-onCommitted",
74 event: "onCommitted", 83 event: "onCommitted",
75 details: { frameId: 0, 84 details: { frameId: 0,
85 processId: 0,
76 tabId: 0, 86 tabId: 0,
77 timeStamp: 0, 87 timeStamp: 0,
78 transitionQualifiers: ["forward_back"], 88 transitionQualifiers: ["forward_back"],
79 transitionType: "link", 89 transitionType: "link",
80 url: getURL('forwardBack/a.html') }}, 90 url: getURL('forwardBack/a.html') }},
81 { label: "c-onDOMContentLoaded", 91 { label: "c-onDOMContentLoaded",
82 event: "onDOMContentLoaded", 92 event: "onDOMContentLoaded",
83 details: { frameId: 0, 93 details: { frameId: 0,
94 processId: 0,
84 tabId: 0, 95 tabId: 0,
85 timeStamp: 0, 96 timeStamp: 0,
86 url: getURL('forwardBack/a.html') }}, 97 url: getURL('forwardBack/a.html') }},
87 { label: "c-onCompleted", 98 { label: "c-onCompleted",
88 event: "onCompleted", 99 event: "onCompleted",
89 details: { frameId: 0, 100 details: { frameId: 0,
101 processId: 0,
90 tabId: 0, 102 tabId: 0,
91 timeStamp: 0, 103 timeStamp: 0,
92 url: getURL('forwardBack/a.html') }}], 104 url: getURL('forwardBack/a.html') }}],
93 [ navigationOrder("a-"), navigationOrder("b-"), navigationOrder("c-"), 105 [ navigationOrder("a-"), navigationOrder("b-"), navigationOrder("c-"),
94 isLoadedBy("b-", "a-"), isLoadedBy("c-", "b-")]); 106 isLoadedBy("b-", "a-"), isLoadedBy("c-", "b-")]);
95 chrome.tabs.update(tabId, { url: getURL('forwardBack/a.html') }); 107 chrome.tabs.update(tabId, { url: getURL('forwardBack/a.html') });
96 }, 108 },
97 ]); 109 ]);
98 }); 110 });
99 } 111 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698