OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 embedder = {}; | 5 var embedder = {}; |
6 embedder.test = {}; | 6 embedder.test = {}; |
7 embedder.baseGuestURL = ''; | 7 embedder.baseGuestURL = ''; |
8 embedder.guestURL = ''; | 8 embedder.guestURL = ''; |
9 | 9 |
10 window.runNewWindowTest = function(testName) { | 10 window.runNewWindowTest = function(testName) { |
11 if (!embedder.test.testList[testName]) { | 11 if (!embedder.test.testList[testName]) { |
12 console.log('Incorrect testName: ' + testName); | 12 console.log('Incorrect testName: ' + testName); |
13 embedder.test.fail(); | 13 embedder.test.fail(); |
14 return; | 14 return; |
15 } | 15 } |
16 | 16 |
17 // Run the test. | 17 // Run the test. |
18 embedder.test.testList[testName](); | 18 embedder.test.testList[testName](); |
19 }; | 19 }; |
20 // window.* exported functions end. | 20 // window.* exported functions end. |
21 | 21 |
22 /** @private */ | 22 /** @private */ |
23 embedder.setUp_ = function(config) { | 23 embedder.setUp_ = function(config) { |
24 embedder.baseGuestURL = 'http://localhost:' + config.testServer.port; | 24 embedder.baseGuestURL = 'http://localhost:' + config.testServer.port; |
25 embedder.guestURL = embedder.baseGuestURL + | 25 embedder.guestURL = embedder.baseGuestURL + |
26 '/files/extensions/platform_apps/web_view/newwindow' + | 26 '/extensions/platform_apps/web_view/newwindow' + |
27 '/guest_opener.html'; | 27 '/guest_opener.html'; |
28 chrome.test.log('Guest url is: ' + embedder.guestURL); | 28 chrome.test.log('Guest url is: ' + embedder.guestURL); |
29 }; | 29 }; |
30 | 30 |
31 /** @private */ | 31 /** @private */ |
32 embedder.setUpGuest_ = function(partitionName) { | 32 embedder.setUpGuest_ = function(partitionName) { |
33 document.querySelector('#webview-tag-container').innerHTML = | 33 document.querySelector('#webview-tag-container').innerHTML = |
34 '<webview style="width: 100px; height: 100px;"></webview>'; | 34 '<webview style="width: 100px; height: 100px;"></webview>'; |
35 var webview = document.querySelector('webview'); | 35 var webview = document.querySelector('webview'); |
36 if (partitionName) { | 36 if (partitionName) { |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 'testNewWindowExecuteScript': testNewWindowExecuteScript, | 314 'testNewWindowExecuteScript': testNewWindowExecuteScript, |
315 'testNewWindowWebRequest': testNewWindowWebRequest | 315 'testNewWindowWebRequest': testNewWindowWebRequest |
316 }; | 316 }; |
317 | 317 |
318 onload = function() { | 318 onload = function() { |
319 chrome.test.getConfig(function(config) { | 319 chrome.test.getConfig(function(config) { |
320 embedder.setUp_(config); | 320 embedder.setUp_(config); |
321 chrome.test.sendMessage('Launched'); | 321 chrome.test.sendMessage('Launched'); |
322 }); | 322 }); |
323 }; | 323 }; |
OLD | NEW |