| Index: chrome/common/origin_util_unittest.cc
|
| diff --git a/chrome/common/origin_util_unittest.cc b/chrome/common/origin_util_unittest.cc
|
| index 63eff639db62a045145a97f0186063d84266cc4a..bb155f1400a90f32b8ad89c9ddbb7de7c462970c 100644
|
| --- a/chrome/common/origin_util_unittest.cc
|
| +++ b/chrome/common/origin_util_unittest.cc
|
| @@ -4,6 +4,8 @@
|
|
|
| #include "chrome/common/origin_util.h"
|
|
|
| +#include "base/command_line.h"
|
| +#include "chrome/common/chrome_switches.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| #include "url/gurl.h"
|
|
|
| @@ -42,4 +44,16 @@ TEST(URLSchemesTest, IsOriginSecure) {
|
| GURL("filesystem:ftp://127.0.0.1/temporary/")));
|
| EXPECT_TRUE(IsOriginSecure(
|
| GURL("filesystem:https://www.example.com/temporary/")));
|
| +
|
| + // Add http://example.com and http://127.example.com to whitelist and
|
| + // check if they are now considered secure origins.
|
| + ClearWhiteListedSecureOrigins();
|
| + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
| + command_line->AppendSwitchASCII(
|
| + switches::kUnsafetyTreatInsecureOriginAsSecure,
|
| + "http://example.com,http://127.example.com");
|
| + command_line->AppendSwitch(switches::kUserDataDir);
|
| + EXPECT_TRUE(IsOriginSecure(GURL("http://example.com/fun.html")));
|
| + EXPECT_TRUE(IsOriginSecure(GURL("http://127.example.com/fun.html")));
|
| + ClearWhiteListedSecureOrigins();
|
| }
|
|
|