| 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")));
|
| +}
|
|
|