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

Side by Side Diff: chrome/test/data/extensions/api_test/tabs/javascript_url_permissions/test.html

Issue 8762014: Move another set of extension tests to manifest_version 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years 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 <script> 1 <!--
2 2 * Copyright (c) 2011 The Chromium Authors. All rights reserved. Use of this
3 chrome.test.getConfig(function(config) { 3 * source code is governed by a BSD-style license that can be found in the
4 var javaScriptURL = "javascript:void(document.body.bgColor='red')"; 4 * LICENSE file.
5 5 -->
6 var fixPort = function(url) { 6 <script src="test.js"></script>
7 return url.replace(/PORT/, config.testServer.port);
8 };
9 var urlA = fixPort("http://a.com:PORT/files/extensions/test_file.html");
10 var urlB = fixPort("http://b.com:PORT/files/extensions/test_file.html");
11
12 chrome.tabs.create({ url: urlA }, function(tab) {
13 var firstTabId = tab.id;
14
15 chrome.tabs.create({ url: urlB }, function(tab) {
16 var secondTabId = tab.id;
17
18 chrome.test.runTests([
19 function javaScriptURLShouldFail() {
20 chrome.tabs.update(firstTabId, {url: javaScriptURL},
21 chrome.test.callbackFail('Cannot access contents of url ' +
22 '"' + urlA + '". Extension manifest must request ' +
23 'permission to access this host.'));
24 },
25
26 function javaScriptURLShouldSucceed() {
27 chrome.tabs.update(secondTabId, {url: javaScriptURL},
28 chrome.test.callbackPass());
29 }
30 ]);
31 });
32 });
33 });
34 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698