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

Unified Diff: chrome/test/data/extensions/api_test/popup/popup_main/dom_ui_popup_dismissal.html

Issue 6334101: Removal of chrome.experimental.popup set of APIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/popup/popup_main/dom_ui_popup_dismissal.html
===================================================================
--- chrome/test/data/extensions/api_test/popup/popup_main/dom_ui_popup_dismissal.html (revision 74596)
+++ chrome/test/data/extensions/api_test/popup/popup_main/dom_ui_popup_dismissal.html (working copy)
@@ -1,67 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<script>
-var onbeforeunloadInvoked= false;
-var onunloadInvoked = false;
-var popupDismissed = false;
-var testingWindow = locateTestingWindow();
-
-// Helper function that locates the main tab that is being used
-// to drive the popup tests.
-function locateTestingWindow() {
- var extensionViews = chrome.extension.getViews();
- for (var i = 0; i < extensionViews.length; ++i) {
- // Look for the magic token defined on the testing page.
- if (typeof extensionViews[i].TESTING_TOKEN != "undefined" &&
- !!extensionViews[i].TESTING_TOKEN) {
- return extensionViews[i];
- }
- }
- return null;
-}
-
-// Onload handler that tests the popup dismissal behaviour when closing the
-// current tab. A popup is launched and the timing of the onClosed callback
-// is tested wrt the onbeforeunload and onunload callbacks.
-window.onload = function() {
- chrome.experimental.popup.onClosed.addListener(function() {
- testingWindow.assertTrue(onbeforeunloadInvoked,
- "Popup dismissed before onbeforeunload called.");
- testingWindow.assertTrue(!onunloadInvoked,
- "Popup dismissed after onunload called.");
- popupDismissed = true;
- });
-
- var showDetails = {
- "relativeTo": document.getElementById("popupAnchor")
- };
- chrome.experimental.popup.show("dom_ui_popup.html",
- showDetails,
- function() {
- chrome.tabs.getSelected(null, function(tab) {
- chrome.tabs.remove(tab.id);
- });
- });
-}
-
-window.onbeforeunload = function() {
- onbeforeunloadInvoked = true;
-}
-
-window.onunload = function() {
- onunloadInvoked = true;
-
- // If the popup was not yet dismissed, do not signal that the test has
- // completed. Let the test time-out to signal failure.
- if (popupDismissed)
- testingWindow.testCompleted();
-};
-</script>
-</head>
-<body>
-Testing Popup Sizing
-<div id='popupAnchor'>
-<span>Anchor Temporary Popup Here</span>
-</div>
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698