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

Side by Side Diff: chrome/test/data/extensions/api_test/webnavigation/test_prerender.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, 4 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) 2012 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 var URL_LOAD = 7 var URL_LOAD =
8 "http://127.0.0.1:PORT/files/prerender/prerender_loader.html"; 8 "http://127.0.0.1:PORT/files/prerender/prerender_loader.html";
9 var URL_TARGET = 9 var URL_TARGET =
10 "http://127.0.0.1:PORT/files/prerender/prerender_page.html"; 10 "http://127.0.0.1:PORT/files/prerender/prerender_page.html";
11 chrome.tabs.create({"url": "about:blank"}, function(tab) { 11 chrome.tabs.create({"url": "about:blank"}, function(tab) {
12 var tabId = tab.id; 12 var tabId = tab.id;
13 chrome.test.getConfig(function(config) { 13 chrome.test.getConfig(function(config) {
14 var fixPort = function(url) { 14 var fixPort = function(url) {
15 return url.replace(/PORT/g, config.testServer.port); 15 return url.replace(/PORT/g, config.testServer.port);
16 }; 16 };
17 URL_LOAD = fixPort(URL_LOAD); 17 URL_LOAD = fixPort(URL_LOAD);
18 URL_TARGET = fixPort(URL_TARGET); 18 URL_TARGET = fixPort(URL_TARGET);
19 19
20 chrome.test.runTests([ 20 chrome.test.runTests([
21 // A prerendered tab replaces the current tab. 21 // A prerendered tab replaces the current tab.
22 function prerendered() { 22 function prerendered() {
23 expect([ 23 expect([
24 { label: "a-onBeforeNavigate", 24 { label: "a-onBeforeNavigate",
25 event: "onBeforeNavigate", 25 event: "onBeforeNavigate",
26 details: { frameId: 0, 26 details: { frameId: 0,
27 processId: 0,
27 tabId: 0, 28 tabId: 0,
28 timeStamp: 0, 29 timeStamp: 0,
29 url: URL_LOAD }}, 30 url: URL_LOAD }},
30 { label: "a-onCommitted", 31 { label: "a-onCommitted",
31 event: "onCommitted", 32 event: "onCommitted",
32 details: { frameId: 0, 33 details: { frameId: 0,
34 processId: 0,
33 tabId: 0, 35 tabId: 0,
34 timeStamp: 0, 36 timeStamp: 0,
35 transitionQualifiers: [], 37 transitionQualifiers: [],
36 transitionType: "typed", 38 transitionType: "typed",
37 url: URL_LOAD }}, 39 url: URL_LOAD }},
38 { label: "a-onDOMContentLoaded", 40 { label: "a-onDOMContentLoaded",
39 event: "onDOMContentLoaded", 41 event: "onDOMContentLoaded",
40 details: { frameId: 0, 42 details: { frameId: 0,
43 processId: 0,
41 tabId: 0, 44 tabId: 0,
42 timeStamp: 0, 45 timeStamp: 0,
43 url: URL_LOAD }}, 46 url: URL_LOAD }},
44 { label: "a-onCompleted", 47 { label: "a-onCompleted",
45 event: "onCompleted", 48 event: "onCompleted",
46 details: { frameId: 0, 49 details: { frameId: 0,
50 processId: 0,
47 tabId: 0, 51 tabId: 0,
48 timeStamp: 0, 52 timeStamp: 0,
49 url: URL_LOAD }}, 53 url: URL_LOAD }},
50 { label: "b-onBeforeNavigate", 54 { label: "b-onBeforeNavigate",
51 event: "onBeforeNavigate", 55 event: "onBeforeNavigate",
52 details: { frameId: 0, 56 details: { frameId: 0,
57 processId: 1,
53 tabId: 1, 58 tabId: 1,
54 timeStamp: 0, 59 timeStamp: 0,
55 url: URL_TARGET }}, 60 url: URL_TARGET }},
56 { label: "b-onCommitted", 61 { label: "b-onCommitted",
57 event: "onCommitted", 62 event: "onCommitted",
58 details: { frameId: 0, 63 details: { frameId: 0,
64 processId: 1,
59 tabId: 1, 65 tabId: 1,
60 timeStamp: 0, 66 timeStamp: 0,
61 transitionQualifiers: [], 67 transitionQualifiers: [],
62 transitionType: "link", 68 transitionType: "link",
63 url: URL_TARGET }}, 69 url: URL_TARGET }},
64 { label: "b-onDOMContentLoaded", 70 { label: "b-onDOMContentLoaded",
65 event: "onDOMContentLoaded", 71 event: "onDOMContentLoaded",
66 details: { frameId: 0, 72 details: { frameId: 0,
73 processId: 1,
67 tabId: 1, 74 tabId: 1,
68 timeStamp: 0, 75 timeStamp: 0,
69 url: URL_TARGET }}, 76 url: URL_TARGET }},
70 { label: "b-onCompleted", 77 { label: "b-onCompleted",
71 event: "onCompleted", 78 event: "onCompleted",
72 details: { frameId: 0, 79 details: { frameId: 0,
80 processId: 1,
73 tabId: 1, 81 tabId: 1,
74 timeStamp: 0, 82 timeStamp: 0,
75 url: URL_TARGET }}, 83 url: URL_TARGET }},
76 { label: "onTabReplaced", 84 { label: "onTabReplaced",
77 event: "onTabReplaced", 85 event: "onTabReplaced",
78 details: { replacedTabId: 0, 86 details: { replacedTabId: 0,
79 tabId: 1, 87 tabId: 1,
80 timeStamp: 0 }}], 88 timeStamp: 0 }}],
81 [ navigationOrder("a-"), 89 [ navigationOrder("a-"),
82 navigationOrder("b-"), 90 navigationOrder("b-"),
83 [ "a-onCompleted", "b-onCompleted", "onTabReplaced" ]]); 91 [ "a-onCompleted", "b-onCompleted", "onTabReplaced" ]]);
84 92
85 // Notify the api test that we're waiting for the user. 93 // Notify the api test that we're waiting for the user.
86 chrome.test.notifyPass(); 94 chrome.test.notifyPass();
87 }, 95 },
88 ]); 96 ]);
89 }); 97 });
90 }); 98 });
91 } 99 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698