| 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
|
|
|