Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/webui/log_web_ui_url.h" | 5 #include "chrome/browser/ui/webui/log_web_ui_url.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 38 LogWebUIUrlTest() {} | 38 LogWebUIUrlTest() {} |
| 39 ~LogWebUIUrlTest() override {} | 39 ~LogWebUIUrlTest() override {} |
| 40 | 40 |
| 41 std::vector<Bucket> GetSamples() { | 41 std::vector<Bucket> GetSamples() { |
| 42 return histogram_tester_.GetAllSamples(webui::kWebUICreatedForUrl); | 42 return histogram_tester_.GetAllSamples(webui::kWebUICreatedForUrl); |
| 43 } | 43 } |
| 44 | 44 |
| 45 void SetUpOnMainThread() override { | 45 void SetUpOnMainThread() override { |
| 46 // Disable MD History to test non-MD history page. | 46 // Disable MD History to test non-MD history page. |
| 47 scoped_feature_list_.InitAndDisableFeature( | 47 scoped_feature_list_.InitAndDisableFeature( |
| 48 features::kMaterialDesignHistory); | 48 features::kMaterialDesignHistory); |
|
Dan Beam
2017/04/18 18:28:42
i'll have to remove this code soon... I'm deleting
| |
| 49 } | 49 } |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 base::test::ScopedFeatureList scoped_feature_list_; | 52 base::test::ScopedFeatureList scoped_feature_list_; |
| 53 base::HistogramTester histogram_tester_; | 53 base::HistogramTester histogram_tester_; |
| 54 | 54 |
| 55 DISALLOW_COPY_AND_ASSIGN(LogWebUIUrlTest); | 55 DISALLOW_COPY_AND_ASSIGN(LogWebUIUrlTest); |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 IN_PROC_BROWSER_TEST_F(LogWebUIUrlTest, TestHistoryFrame) { | 58 IN_PROC_BROWSER_TEST_F(LogWebUIUrlTest, TestHistoryFrame) { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 117 } | 117 } |
| 118 | 118 |
| 119 GURL extensions_frame_url(chrome::kChromeUIExtensionsFrameURL); | 119 GURL extensions_frame_url(chrome::kChromeUIExtensionsFrameURL); |
| 120 uint32_t extensions_frame_url_hash = base::Hash(extensions_frame_url.spec()); | 120 uint32_t extensions_frame_url_hash = base::Hash(extensions_frame_url.spec()); |
| 121 | 121 |
| 122 EXPECT_THAT(GetSamples(), ElementsAre(Bucket(extensions_frame_url_hash, 1), | 122 EXPECT_THAT(GetSamples(), ElementsAre(Bucket(extensions_frame_url_hash, 1), |
| 123 Bucket(history_frame_url_hash, 2), | 123 Bucket(history_frame_url_hash, 2), |
| 124 Bucket(uber_frame_url_hash, 2), | 124 Bucket(uber_frame_url_hash, 2), |
| 125 Bucket(uber_url_hash, 2))); | 125 Bucket(uber_url_hash, 2))); |
| 126 } | 126 } |
| 127 | |
| 128 IN_PROC_BROWSER_TEST_F(LogWebUIUrlTest, TestExtensionsPage) { | |
| 129 content::WebContents* tab = | |
| 130 browser()->tab_strip_model()->GetActiveWebContents(); | |
| 131 | |
| 132 base::string16 extension_title = | |
| 133 l10n_util::GetStringUTF16(IDS_MANAGE_EXTENSIONS_SETTING_WINDOWS_TITLE); | |
| 134 | |
| 135 { | |
| 136 content::TitleWatcher title_watcher(tab, extension_title); | |
| 137 ui_test_utils::NavigateToURL(browser(), | |
| 138 GURL(chrome::kChromeUIExtensionsURL)); | |
| 139 ASSERT_EQ(extension_title, title_watcher.WaitAndGetTitle()); | |
| 140 } | |
| 141 | |
| 142 std::string scheme(content::kChromeUIScheme); | |
| 143 GURL uber_url(scheme + "://" + chrome::kChromeUIUberHost); | |
| 144 uint32_t uber_url_hash = base::Hash(uber_url.spec()); | |
| 145 | |
| 146 GURL uber_frame_url(chrome::kChromeUIUberFrameURL); | |
| 147 uint32_t uber_frame_url_hash = base::Hash(uber_frame_url.spec()); | |
| 148 | |
| 149 GURL extensions_frame_url(chrome::kChromeUIExtensionsFrameURL); | |
| 150 uint32_t extensions_frame_url_hash = base::Hash(extensions_frame_url.spec()); | |
| 151 | |
| 152 EXPECT_THAT(GetSamples(), ElementsAre(Bucket(extensions_frame_url_hash, 1), | |
| 153 Bucket(uber_frame_url_hash, 1), | |
| 154 Bucket(uber_url_hash, 1))); | |
| 155 } | |
| 127 #endif | 156 #endif |
| 128 | 157 |
| 129 } // namespace webui | 158 } // namespace webui |
| OLD | NEW |