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

Unified Diff: content/common/origin_util_unittest.cc

Issue 1101033003: Move IsOriginSecure() into //content and use it in ServiceWorker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added disallow copy/assign Created 5 years, 8 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 | « content/common/origin_util.cc ('k') | content/content_common.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/origin_util_unittest.cc
diff --git a/chrome/common/origin_util_unittest.cc b/content/common/origin_util_unittest.cc
similarity index 62%
rename from chrome/common/origin_util_unittest.cc
rename to content/common/origin_util_unittest.cc
index 63eff639db62a045145a97f0186063d84266cc4a..2991a9d960b7f8afc79ea937c68bee0970d5b8bc 100644
--- a/chrome/common/origin_util_unittest.cc
+++ b/content/common/origin_util_unittest.cc
@@ -1,12 +1,14 @@
-// Copyright (c) 2015 The Chromium Authors. All rights reserved.
+// 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 "chrome/common/origin_util.h"
-
+#include "base/basictypes.h"
+#include "content/public/common/origin_util.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
+namespace content {
+
TEST(URLSchemesTest, IsOriginSecure) {
EXPECT_TRUE(IsOriginSecure(GURL("file:///test/fun.html")));
EXPECT_TRUE(IsOriginSecure(GURL("file:///test/")));
@@ -24,22 +26,20 @@ TEST(URLSchemesTest, IsOriginSecure) {
EXPECT_TRUE(IsOriginSecure(GURL("http://127.0.0.1/fun.html")));
EXPECT_TRUE(IsOriginSecure(GURL("ftp://127.0.0.1/fun.html")));
EXPECT_TRUE(IsOriginSecure(GURL("http://127.3.0.1/fun.html")));
- EXPECT_FALSE(
- IsOriginSecure(GURL("http://127.example.com/fun.html")));
- EXPECT_TRUE(
- IsOriginSecure(GURL("https://127.example.com/fun.html")));
+ EXPECT_FALSE(IsOriginSecure(GURL("http://127.example.com/fun.html")));
+ EXPECT_TRUE(IsOriginSecure(GURL("https://127.example.com/fun.html")));
EXPECT_TRUE(IsOriginSecure(GURL("http://[::1]/fun.html")));
EXPECT_FALSE(IsOriginSecure(GURL("http://[::2]/fun.html")));
+ EXPECT_FALSE(IsOriginSecure(GURL("http://[::1].example.com/fun.html")));
+
+ EXPECT_FALSE(
+ IsOriginSecure(GURL("filesystem:http://www.example.com/temporary/")));
EXPECT_FALSE(
- IsOriginSecure(GURL("http://[::1].example.com/fun.html")));
-
- EXPECT_FALSE(IsOriginSecure(
- GURL("filesystem:http://www.example.com/temporary/")));
- EXPECT_FALSE(IsOriginSecure(
- GURL("filesystem:ftp://www.example.com/temporary/")));
- EXPECT_TRUE(IsOriginSecure(
- GURL("filesystem:ftp://127.0.0.1/temporary/")));
- EXPECT_TRUE(IsOriginSecure(
- GURL("filesystem:https://www.example.com/temporary/")));
+ IsOriginSecure(GURL("filesystem:ftp://www.example.com/temporary/")));
+ EXPECT_TRUE(IsOriginSecure(GURL("filesystem:ftp://127.0.0.1/temporary/")));
+ EXPECT_TRUE(
+ IsOriginSecure(GURL("filesystem:https://www.example.com/temporary/")));
}
+
+} // namespace content
« no previous file with comments | « content/common/origin_util.cc ('k') | content/content_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698