OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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 chrome.test.runTests([ |
| 6 // Tests if the <extensionoptions> guest view is successfully created. This |
| 7 // test expects that the guest options page will add a {'pass': true} property |
| 8 // to every Window and fire the runtime.onMessage event with a short message. |
| 9 function createExtensionOptionsGuest() { |
| 10 chrome.runtime.onMessage.addListener( |
| 11 function(message, sender, sendResponse) { |
| 12 var windows = chrome.extension.getViews(); |
| 13 for (var i = 0; i < windows.length; ++i) |
| 14 chrome.test.assertTrue(windows[i].pass); |
| 15 chrome.test.assertTrue('hi' == message); |
| 16 chrome.test.succeed(); |
| 17 }); |
| 18 |
| 19 var extensionoptions = document.createElement('extensionoptions'); |
| 20 extensionoptions.setAttribute('extension', chrome.runtime.id); |
| 21 document.body.appendChild(extensionoptions); |
| 22 } |
| 23 ]); |
OLD | NEW |