| OLD | NEW |
| 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 var expectedEventData; | 5 var expectedEventData; |
| 6 var capturedEventData; | 6 var capturedEventData; |
| 7 var shouldIgnore; | 7 var shouldIgnore; |
| 8 | 8 |
| 9 function expect(data, ignoreFunc) { | 9 function expect(data, ignoreFunc) { |
| 10 expectedEventData = data; | 10 expectedEventData = data; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 { status: 'loading', url: getURL('browserThenRendererInitiated/b.html') }, | 43 { status: 'loading', url: getURL('browserThenRendererInitiated/b.html') }, |
| 44 { status: 'complete' }, | 44 { status: 'complete' }, |
| 45 ]); | 45 ]); |
| 46 | 46 |
| 47 chrome.tabs.create({ url: getURL('browserThenRendererInitiated/a.html') }); | 47 chrome.tabs.create({ url: getURL('browserThenRendererInitiated/a.html') }); |
| 48 }, | 48 }, |
| 49 | 49 |
| 50 function newTab() { | 50 function newTab() { |
| 51 // Test for crbug.com/27208. | 51 // Test for crbug.com/27208. |
| 52 expect([ | 52 expect([ |
| 53 { title : "New Tab" }, |
| 53 { status: 'loading', url: 'chrome://newtab/' }, | 54 { status: 'loading', url: 'chrome://newtab/' }, |
| 54 { status: 'complete' } | 55 { status: 'complete' } |
| 55 ]); | 56 ], function(info) { |
| 57 // TODO(jam): remove this logic and the title line above when PlzNavigate |
| 58 // is turned on by default. Right now the test has to handle both cases |
| 59 // which have different timing. http://crbug.com/368813 |
| 60 if (info.status === 'loading' && capturedEventData.length == 0) { |
| 61 expectedEventData.shift(); |
| 62 } |
| 63 return false; |
| 64 }); |
| 56 | 65 |
| 57 chrome.tabs.create({ url: 'chrome://newtab/' }); | 66 chrome.tabs.create({ url: 'chrome://newtab/' }); |
| 58 }, | 67 }, |
| 59 | 68 |
| 60 /* | 69 /* |
| 61 // TODO(rafaelw) -- This is disabled because this test is flakey. | 70 // TODO(rafaelw) -- This is disabled because this test is flakey. |
| 62 function updateDuringCreateCallback() { | 71 function updateDuringCreateCallback() { |
| 63 // Test for crbug.com/27204. | 72 // Test for crbug.com/27204. |
| 64 // We have to ignore anything that comes before the about:blank loading | 73 // We have to ignore anything that comes before the about:blank loading |
| 65 // status. | 74 // status. |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 expect([ | 134 expect([ |
| 126 { status: 'loading', url: getURL('title/test.html') }, | 135 { status: 'loading', url: getURL('title/test.html') }, |
| 127 { status: 'complete' }, | 136 { status: 'complete' }, |
| 128 { title: 'foo' }, | 137 { title: 'foo' }, |
| 129 { title: 'bar' } | 138 { title: 'bar' } |
| 130 ]); | 139 ]); |
| 131 | 140 |
| 132 chrome.tabs.create({ url: getURL('title/test.html') }); | 141 chrome.tabs.create({ url: getURL('title/test.html') }); |
| 133 } | 142 } |
| 134 ]); | 143 ]); |
| OLD | NEW |