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

Unified Diff: chrome/browser/ui/webui/settings/md_settings_ui_unittest.cc

Issue 2919663002: MD Settings: change how valid origins are checked and tested (Closed)
Patch Set: move md_settings_ui_unittest.cc in chrome/test/BUILD.gn Created 3 years, 7 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 | « chrome/browser/ui/webui/settings/md_settings_ui_browsertest.cc ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/settings/md_settings_ui_unittest.cc
diff --git a/chrome/browser/ui/webui/settings/md_settings_ui_unittest.cc b/chrome/browser/ui/webui/settings/md_settings_ui_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..01b5041076103fb3c8f065cc76db5dfaa746fb5c
--- /dev/null
+++ b/chrome/browser/ui/webui/settings/md_settings_ui_unittest.cc
@@ -0,0 +1,20 @@
+// Copyright 2017 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/browser/ui/webui/settings/md_settings_ui.h"
+
+#include "chrome/common/url_constants.h"
+#include "content/public/common/url_constants.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "url/gurl.h"
+
+TEST(MdSettingsUITest, IsValidOrigin) {
+ EXPECT_TRUE(settings::IsValidOrigin(GURL(chrome::kChromeUISettingsURL)));
+ EXPECT_TRUE(settings::IsValidOrigin(GURL(chrome::kChromeUIMdSettingsURL)));
+
+ EXPECT_FALSE(settings::IsValidOrigin(GURL("http://evil.com")));
+ EXPECT_FALSE(settings::IsValidOrigin(GURL("https://google.com")));
+ EXPECT_FALSE(settings::IsValidOrigin(GURL(chrome::kChromeUINewTabURL)));
+ EXPECT_FALSE(settings::IsValidOrigin(GURL(chrome::kChromeUIHistoryURL)));
+}
« no previous file with comments | « chrome/browser/ui/webui/settings/md_settings_ui_browsertest.cc ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698