| Index: chrome/test/data/extensions/api_test/active_tab/iframe.js
|
| diff --git a/chrome/test/data/extensions/api_test/active_tab/iframe.js b/chrome/test/data/extensions/api_test/active_tab/iframe.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..b4c59ccd8f4c22a041bed5b65e64279e384aaff7
|
| --- /dev/null
|
| +++ b/chrome/test/data/extensions/api_test/active_tab/iframe.js
|
| @@ -0,0 +1,23 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +function canXhr(url) {
|
| + var xhr = new XMLHttpRequest();
|
| + xhr.open('GET', url, false);
|
| + var success = true;
|
| + try {
|
| + xhr.send();
|
| + } catch(e) {
|
| + assertEq('NetworkError', e.name);
|
| + success = false;
|
| + }
|
| + return success;
|
| +}
|
| +
|
| +document.addEventListener('DOMContentLoaded', function() {
|
| + chrome.runtime.sendMessage({message:'xhr'}, function(response) {
|
| + var success = canXhr(response.url);
|
| + chrome.runtime.sendMessage({success:success});
|
| + });
|
| +});
|
|
|