| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 config; | 5 var config; |
| 6 var MAIN_HOST = 'b.com'; | 6 var MAIN_HOST = 'b.com'; |
| 7 var OTHER_HOST = 'c.com'; | 7 var OTHER_HOST = 'c.com'; |
| 8 | 8 |
| 9 var DOMContentLoadedEventsInFrame = []; | 9 var DOMContentLoadedEventsInFrame = []; |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 function onDOMContentLoaded(details) { | 41 function onDOMContentLoaded(details) { |
| 42 if (details.frameId > 0) { | 42 if (details.frameId > 0) { |
| 43 DOMContentLoadedEventsInFrame.push(details); | 43 DOMContentLoadedEventsInFrame.push(details); |
| 44 } | 44 } |
| 45 } | 45 } |
| 46 }); | 46 }); |
| 47 | 47 |
| 48 function startTest(tabId) { | 48 function startTest(tabId) { |
| 49 // The default font color of any document. | 49 // The default font color of any document. |
| 50 var kDefaultColor = getComputedStyle(document.body).color; | 50 var kDefaultColor = getComputedStyle(document.body).color; |
| 51 var kExpectedFontFamily = '\'expected font-family\''; | 51 var kExpectedFontFamily = '"expected font-family"'; |
| 52 var kExpectedColor = 'rgb(123, 123, 123)'; | 52 var kExpectedColor = 'rgb(123, 123, 123)'; |
| 53 | 53 |
| 54 // The page has a child frame containing a HTTP 204 page. | 54 // The page has a child frame containing a HTTP 204 page. |
| 55 // In response to HTTP 204 (No Content), the browser stops navigating away and | 55 // In response to HTTP 204 (No Content), the browser stops navigating away and |
| 56 // stays at the previous page. In this test, the URL leading to HTTP 204 was | 56 // stays at the previous page. In this test, the URL leading to HTTP 204 was |
| 57 // the initial URL of the frame, so in response to HTTP 204, the frame should | 57 // the initial URL of the frame, so in response to HTTP 204, the frame should |
| 58 // end at about:blank. | 58 // end at about:blank. |
| 59 | 59 |
| 60 // Each chrome.tabs.insertCSS test is followed by a test using executeScript. | 60 // Each chrome.tabs.insertCSS test is followed by a test using executeScript. |
| 61 // These executeScript tests exists for two reasons: | 61 // These executeScript tests exists for two reasons: |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 return; | 299 return; |
| 300 } | 300 } |
| 301 chrome.test.assertEq([ | 301 chrome.test.assertEq([ |
| 302 // Should run the content scripts even after a navigation to 204. | 302 // Should run the content scripts even after a navigation to 204. |
| 303 [1, 1, true], | 303 [1, 1, true], |
| 304 // Should not inject non-matching scripts. | 304 // Should not inject non-matching scripts. |
| 305 [null, null], | 305 [null, null], |
| 306 ], results[1]); | 306 ], results[1]); |
| 307 })); | 307 })); |
| 308 } | 308 } |
| OLD | NEW |