Index: chrome/test/data/extensions/api_test/app_background_page/common/c.html |
diff --git a/chrome/test/data/extensions/api_test/app_background_page/common/c.html b/chrome/test/data/extensions/api_test/app_background_page/common/c.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..651a0f4b685a285250cd8329c4058bec28a876a6 |
--- /dev/null |
+++ b/chrome/test/data/extensions/api_test/app_background_page/common/c.html |
@@ -0,0 +1,31 @@ |
+<script src="common.js"></script> |
+<h1 id="status">Page C</h1> |
+<div style="display:none" id="pageToScriptTunnel"></div> |
+<div style="display:none" id="scriptToPageTunnel"></div> |
+ |
+<script> |
+var backgroundWindow; |
+ |
+window.onload = function() { |
+ setupScriptTunnel(); |
+ // Note we are using a different window name than a.html so this should open |
+ // a different background page. |
+ backgroundWindow = window.open('bg.html', 'bg2', 'background'); |
+ if (backgroundWindow) { |
+ setStatus('background page opened'); |
+ } else { |
+ notifyBackgroundPagePermissionDenied(); |
+ setStatus('background page permission denied'); |
+ } |
+} |
+ |
+function onBackgroundPageLoaded() { |
+ if (!backgroundWindow.checkAndIncrementCounter(0)) { |
+ notifyCounterError(); |
+ return; |
+ } |
+ |
+ setStatus('background page loaded'); |
+ notifyBackgroundPageLoaded(); |
+} |
+</script> |