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

Unified Diff: third_party/WebKit/Source/core/page/WindowFeaturesTest.cpp

Issue 1459603002: Implement the 'noopener' window feature. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nasko Created 5 years, 1 month 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 | « third_party/WebKit/Source/core/page/WindowFeatures.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/page/WindowFeaturesTest.cpp
diff --git a/third_party/WebKit/Source/core/page/WindowFeaturesTest.cpp b/third_party/WebKit/Source/core/page/WindowFeaturesTest.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..4521448b44f63283356633ed5a03314a0acdc9b3
--- /dev/null
+++ b/third_party/WebKit/Source/core/page/WindowFeaturesTest.cpp
@@ -0,0 +1,37 @@
+// 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.
+//
+#include "config.h"
+#include "core/page/WindowFeatures.h"
+
+#include "wtf/text/WTFString.h"
+#include <gtest/gtest.h>
+
+namespace blink {
+
+using WindowFeaturesTest = ::testing::Test;
+
+TEST_F(WindowFeaturesTest, NoOpener)
+{
+ static const struct {
+ const char* featureString;
+ bool noopener;
+ } cases[] = {
+ { "", false },
+ { "something", false },
+ { "something, something", false },
+ { "notnoopener", false },
+ { "noopener", true },
+ { "something, noopener", true },
+ { "noopener, something", true },
+ { "NoOpEnEr", true },
+ };
+
+ for (const auto& test : cases) {
+ WindowFeatures features(test.featureString);
+ EXPECT_EQ(test.noopener, features.noopener) << "Testing '" << test.featureString << "'";
+ }
+}
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/page/WindowFeatures.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698