1 // Copyright 2015 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.
5 // location.origin will be equivalent to 'http://example.com:PORT';
6 var baseUrl
= location
.origin
;
8 chrome
.test
.sendMessage('contentscript_ready', function() {
9 var x
= new XMLHttpRequest();
10 x
.open('GET', baseUrl
+ '/extensions/test_file.txt?contentscript');
11 x
.onloadend = function() {
12 chrome
.test
.assertEq('Hello!', x
.responseText
);
14 chrome
.test
.sendMessage('contentscript_done', function() {
15 var frame
= document
.createElement('iframe');
16 frame
.src
= chrome
.runtime
.getURL('frame.html');
17 document
.body
.appendChild(frame
);