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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/Window/open-as-popup-vs-tab.html

Issue 2773573002: window.open() should gate new tab/new popup based on toolbar visibility. (Closed)
Patch Set: buttons Created 3 years, 9 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/ChromeClientImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/dom/Window/open-as-popup-vs-tab.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/open-as-popup-vs-tab.html b/third_party/WebKit/LayoutTests/fast/dom/Window/open-as-popup-vs-tab.html
new file mode 100644
index 0000000000000000000000000000000000000000..ba9c77af46098d74d6b25625e84501840022a6e7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/open-as-popup-vs-tab.html
@@ -0,0 +1,40 @@
+<!doctype html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>window.open: popup vs tab</title>
+ <script src="../../../resources/testharness.js"></script>
+ <script src="../../../resources/testharnessreport.js"></script>
+</head>
+<body>
+ <script>
+ function openToolbarOnWindow() {
+ return window.open("", "", "toolbar=1");
+ };
+ function openToolbarOffWindow() {
+ return window.open("", "", "toolbar=0");
+ }
+ function openDefaultFeaturesWindow() {
+ return window.open();
+ }
+ test(function() {
+ var w = openToolbarOnWindow();
+ assert_equals(w.toolbar.visible, true);
+ w.close();
+ }, "window.open with toolbar=1 creates a new tab");
+ test(function() {
+ var w = openToolbarOffWindow();
+ assert_equals(w.toolbar.visible, false);
+ w.close();
+ }, "window.open with toolbar=0 creates a new popup");
+ test(function() {
+ var w = openDefaultFeaturesWindow();
+ assert_equals(w.toolbar.visible, true);
+ w.close();
+ }, "window.open defaults to creating a new tab");
+ </script>
+ <button onclick="openToolbarOnWindow()">Window Features: toolbar=1</button>
+ <button onclick="openToolbarOffWindow()">Window Features: toolbar=0</button>
+ <button onclick="openDefaultFeaturesWindow()">Window Features: default</button>
+</body>
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/ChromeClientImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698