| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // This tests that we are running in the same global context as script1a.js. | |
| 6 function testScriptFilesRunInSameContext() { | |
| 7 assert(script1_var === 1); | |
| 8 } | |
| 9 | |
| 10 // This tests that our relationship to content is working correctly. | |
| 11 // a) We should not see content globals in our global scope. | |
| 12 // b) We should have a contentWindow object that looks like a DOM Window. | |
| 13 // c) We should be able to access content globals via contentWindow. | |
| 14 function testContentInteraction() { | |
| 15 assert(typeof content_var == "undefined"); | |
| 16 assert(typeof contentWindow != "undefined"); | |
| 17 assert(contentWindow.location.href.match(/content_script_inject_page.html$/)); | |
| 18 assert(contentWindow.content_var == "hello"); | |
| 19 } | |
| 20 | |
| 21 // Test that our css in script1.css was injected successfully. | |
| 22 function testCSSWasInjected() { | |
| 23 assert(document.defaultView.getComputedStyle( | |
| 24 document.body, null)["background-color"] == "rgb(255, 0, 0)"); | |
| 25 } | |
| 26 | |
| 27 runAllTests(); | |
| OLD | NEW |