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

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

Issue 11791018: When an iframe displays its srcdoc, generate navigation events for about:srcdoc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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
« no previous file with comments | « chrome/test/data/extensions/api_test/webnavigation/test_srcdoc.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 onload = function() { 5 onload = function() {
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 chrome.test.runTests([ 10 chrome.test.runTests([
10 // Navigates to a.html that redirects to b.html (using javascript). 11 // Navigates to a.html which includes an iframe with a srcdoc attribute.
11 function clientRedirect() { 12 function srcdoc() {
12 expect([ 13 expect([
13 { label: "a-onBeforeNavigate", 14 { label: "a-onBeforeNavigate",
14 event: "onBeforeNavigate", 15 event: "onBeforeNavigate",
15 details: { frameId: 0, 16 details: { frameId: 0,
16 parentFrameId: -1, 17 parentFrameId: -1,
17 processId: 0, 18 processId: 0,
18 tabId: 0, 19 tabId: 0,
19 timeStamp: 0, 20 timeStamp: 0,
20 url: getURL('clientRedirect/a.html') }}, 21 url: getURL('srcdoc/a.html') }},
21 { label: "a-onCommitted", 22 { label: "a-onCommitted",
22 event: "onCommitted", 23 event: "onCommitted",
23 details: { frameId: 0, 24 details: { frameId: 0,
24 processId: 0, 25 processId: 0,
25 tabId: 0, 26 tabId: 0,
26 timeStamp: 0, 27 timeStamp: 0,
27 transitionQualifiers: [], 28 transitionQualifiers: [],
28 transitionType: "link", 29 transitionType: "link",
29 url: getURL('clientRedirect/a.html') }}, 30 url: getURL('srcdoc/a.html') }},
30 { label: "a-onDOMContentLoaded", 31 { label: "a-onDOMContentLoaded",
31 event: "onDOMContentLoaded", 32 event: "onDOMContentLoaded",
32 details: { frameId: 0, 33 details: { frameId: 0,
33 processId: 0, 34 processId: 0,
34 tabId: 0, 35 tabId: 0,
35 timeStamp: 0, 36 timeStamp: 0,
36 url: getURL('clientRedirect/a.html') }}, 37 url: getURL('srcdoc/a.html') }},
37 { label: "a-onCompleted", 38 { label: "a-onCompleted",
38 event: "onCompleted", 39 event: "onCompleted",
39 details: { frameId: 0, 40 details: { frameId: 0,
40 processId: 0, 41 processId: 0,
41 tabId: 0, 42 tabId: 0,
42 timeStamp: 0, 43 timeStamp: 0,
43 url: getURL('clientRedirect/a.html') }}, 44 url: getURL('srcdoc/a.html') }},
44 { label: "b-onBeforeNavigate", 45 { label: "b-onBeforeNavigate",
45 event: "onBeforeNavigate", 46 event: "onBeforeNavigate",
46 details: { frameId: 0, 47 details: { frameId: 1,
47 parentFrameId: -1, 48 parentFrameId: 0,
48 processId: 0, 49 processId: 0,
49 tabId: 0, 50 tabId: 0,
50 timeStamp: 0, 51 timeStamp: 0,
51 url: getURL('clientRedirect/b.html') }}, 52 url: 'about:srcdoc' }},
52 { label: "b-onCommitted", 53 { label: "b-onCommitted",
53 event: "onCommitted", 54 event: "onCommitted",
54 details: { frameId: 0, 55 details: { frameId: 1,
55 processId: 0, 56 processId: 0,
56 tabId: 0, 57 tabId: 0,
57 timeStamp: 0, 58 timeStamp: 0,
58 transitionQualifiers: ["client_redirect"], 59 transitionQualifiers: [],
59 transitionType: "link", 60 transitionType: "auto_subframe",
60 url: getURL('clientRedirect/b.html') }}, 61 url: 'about:srcdoc' }},
61 { label: "b-onDOMContentLoaded", 62 { label: "b-onDOMContentLoaded",
62 event: "onDOMContentLoaded", 63 event: "onDOMContentLoaded",
63 details: { frameId: 0, 64 details: { frameId: 1,
64 processId: 0, 65 processId: 0,
65 tabId: 0, 66 tabId: 0,
66 timeStamp: 0, 67 timeStamp: 0,
67 url: getURL('clientRedirect/b.html') }}, 68 url: 'about:srcdoc' }},
68 { label: "b-onCompleted", 69 { label: "b-onCompleted",
69 event: "onCompleted", 70 event: "onCompleted",
70 details: { frameId: 0, 71 details: { frameId: 1,
71 processId: 0, 72 processId: 0,
72 tabId: 0, 73 tabId: 0,
73 timeStamp: 0, 74 timeStamp: 0,
74 url: getURL('clientRedirect/b.html') }}], 75 url: 'about:srcdoc' }}],
75 [ navigationOrder("a-"), 76 [ navigationOrder("a-"),
76 navigationOrder("b-"), 77 navigationOrder("b-"),
77 isLoadedBy("b-", "a-") ]); 78 isIFrameOf("b-", "a-")]);
78 chrome.tabs.update(tabId, { url: getURL('clientRedirect/a.html') }); 79 chrome.tabs.update(tabId, { url: getURL('srcdoc/a.html') });
79 }, 80 },
80 ]); 81 ]);
81 }); 82 });
82 }; 83 };
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/api_test/webnavigation/test_srcdoc.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698