Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1246)

Side by Side Diff: chrome/test/data/extensions/platform_apps/web_view/common/utils.js

Issue 16268017: GTTF: convert some tests in chrome to use EmbeddedTestServer patch nr 1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 $ = function(id) { return document.getElementById(id); }; 5 var $ = function(id) { return document.getElementById(id); };
6 var LOG = function(msg) { window.console.log(msg); }; 6 var LOG = function(msg) { window.console.log(msg); };
7 7
8 var embedder = {}; 8 var embedder = {};
9 embedder.baseGuestURL = ''; 9 embedder.baseGuestURL = '';
10 embedder.guestURL = ''; 10 embedder.guestURL = '';
(...skipping 19 matching lines...) Expand all
30 chrome.test.fail(opt_msg || ''); 30 chrome.test.fail(opt_msg || '');
31 }; 31 };
32 32
33 utils.test.assertEq = function(expected, actual) { 33 utils.test.assertEq = function(expected, actual) {
34 chrome.test.assertEq.apply(chrome.test.assertEq, arguments); 34 chrome.test.assertEq.apply(chrome.test.assertEq, arguments);
35 }; 35 };
36 36
37 utils.setUp = function(chromeConfig, config) { 37 utils.setUp = function(chromeConfig, config) {
38 embedder.baseGuestURL = 'http://localhost:' + chromeConfig.testServer.port; 38 embedder.baseGuestURL = 'http://localhost:' + chromeConfig.testServer.port;
39 embedder.guestURL = embedder.baseGuestURL + 39 embedder.guestURL = embedder.baseGuestURL +
40 '/files/extensions/platform_apps/web_view/common/' + 40 '/extensions/platform_apps/web_view/common/' +
41 config.TEST_DIR + '/guest.html'; 41 config.TEST_DIR + '/guest.html';
42 chrome.test.log('Guest url is: ' + embedder.guestURL); 42 chrome.test.log('Guest url is: ' + embedder.guestURL);
43 }; 43 };
44 44
45 utils.injectCss = function(cssScriptPath) { 45 utils.injectCss = function(cssScriptPath) {
46 LOG('BEG utils.injectCss: ' + cssScriptPath); 46 LOG('BEG utils.injectCss: ' + cssScriptPath);
47 var style = document.createElement('style'); 47 var style = document.createElement('style');
48 style.type = 'text/css'; 48 style.type = 'text/css';
49 style.src = cssScriptPath; 49 style.src = cssScriptPath;
50 document.getElementsByTagName('head')[0].appendChild(style); 50 document.getElementsByTagName('head')[0].appendChild(style);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 chrome.test.log('Unexpected response from guest'); 84 chrome.test.log('Unexpected response from guest');
85 utils.test.fail(); 85 utils.test.fail();
86 } 86 }
87 } 87 }
88 }; 88 };
89 89
90 window.addEventListener('message', onPostMessageReceived); 90 window.addEventListener('message', onPostMessageReceived);
91 embedder.webview.setAttribute('src', embedder.guestURL); 91 embedder.webview.setAttribute('src', embedder.guestURL);
92 }; 92 };
93 93
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698