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

Unified Diff: chrome/browser/ui/chrome_pages_unittest.cc

Issue 2034573002: [Cleanup] Factor out common code. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Wherein we relearn that "commit -a" doesn't add new files. Created 4 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
Index: chrome/browser/ui/chrome_pages_unittest.cc
diff --git a/chrome/browser/ui/chrome_pages_unittest.cc b/chrome/browser/ui/chrome_pages_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..30e440624ccc6c7ad8855b2a84782163263008a0
--- /dev/null
+++ b/chrome/browser/ui/chrome_pages_unittest.cc
@@ -0,0 +1,25 @@
+// Copyright (c) 2016 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/chrome_pages.h"
+
+#include "chrome/common/url_constants.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+TEST(ChromePagesTest, IsInternalPage) {
+ EXPECT_TRUE(chrome::IsInternalPage(GURL(chrome::kChromeUIDownloadsURL)));
+ EXPECT_TRUE(chrome::IsInternalPage(GURL(chrome::kChromeUIHistoryURL)));
+ EXPECT_TRUE(chrome::IsInternalPage(GURL(chrome::kChromeUINewTabURL)));
+ EXPECT_TRUE(chrome::IsInternalPage(GURL(chrome::kChromeUISettingsURL)));
+
+// Debugging URLs are not included.
+#if defined(OS_CHROMEOS)
+ EXPECT_FALSE(chrome::IsInternalPage(GURL(chrome::kChromeUIDiscardsURL)));
+#endif
+ EXPECT_FALSE(
+ chrome::IsInternalPage(GURL(chrome::kChromeUINetInternalsURL)));
+
+ // Prefix matches are included.
+ EXPECT_TRUE(
+ chrome::IsInternalPage(GURL("chrome://settings/fakeSetting")));
+}

Powered by Google App Engine
This is Rietveld 408576698