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.tests = {}; | 6 embedder.tests = {}; |
7 embedder.baseGuestURL = ''; | 7 embedder.baseGuestURL = ''; |
8 embedder.guestURL = ''; | 8 embedder.guestURL = ''; |
9 | 9 |
10 embedder.setUp = function(config) { | 10 embedder.setUp = function(config) { |
11 embedder.baseGuestURL = 'http://localhost:' + config.testServer.port; | 11 embedder.baseGuestURL = 'http://localhost:' + config.testServer.port; |
12 embedder.guestURL = embedder.baseGuestURL + | 12 embedder.guestURL = embedder.baseGuestURL + |
13 '/files/extensions/platform_apps/web_view/focus' + | 13 '/extensions/platform_apps/web_view/focus' + |
14 '/guest.html'; | 14 '/guest.html'; |
15 chrome.test.log('Guest url is: ' + embedder.guestURL); | 15 chrome.test.log('Guest url is: ' + embedder.guestURL); |
16 }; | 16 }; |
17 | 17 |
18 /** @private */ | 18 /** @private */ |
19 embedder.setUpGuest_ = function() { | 19 embedder.setUpGuest_ = function() { |
20 document.querySelector('#webview-tag-container').innerHTML = | 20 document.querySelector('#webview-tag-container').innerHTML = |
21 '<webview style="width: 100px; height: 100px;"></webview>'; | 21 '<webview style="width: 100px; height: 100px;"></webview>'; |
22 var webview = document.querySelector('webview'); | 22 var webview = document.querySelector('webview'); |
23 if (!webview) { | 23 if (!webview) { |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 101 |
102 onload = function() { | 102 onload = function() { |
103 chrome.test.getConfig(function(config) { | 103 chrome.test.getConfig(function(config) { |
104 embedder.setUp(config); | 104 embedder.setUp(config); |
105 chrome.test.runTests([ | 105 chrome.test.runTests([ |
106 embedder.tests.testFocusEvent, | 106 embedder.tests.testFocusEvent, |
107 embedder.tests.testBlurEvent | 107 embedder.tests.testBlurEvent |
108 ]); | 108 ]); |
109 }); | 109 }); |
110 }; | 110 }; |
OLD | NEW |