| 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 24 matching lines...) Expand all Loading... |
| 35 public: | 35 public: |
| 36 LogWebUIUrlTest() {} | 36 LogWebUIUrlTest() {} |
| 37 ~LogWebUIUrlTest() override {} | 37 ~LogWebUIUrlTest() override {} |
| 38 | 38 |
| 39 std::vector<Bucket> GetSamples() { | 39 std::vector<Bucket> GetSamples() { |
| 40 return histogram_tester_.GetAllSamples(webui::kWebUICreatedForUrl); | 40 return histogram_tester_.GetAllSamples(webui::kWebUICreatedForUrl); |
| 41 } | 41 } |
| 42 | 42 |
| 43 void SetUpOnMainThread() override { | 43 void SetUpOnMainThread() override { |
| 44 // Disable MD History to test non-MD history page. | 44 // Disable MD History to test non-MD history page. |
| 45 MdHistoryUI::DisableForTesting(); | 45 MdHistoryUI::SetEnabledForTesting(false); |
| 46 } | 46 } |
| 47 | 47 |
| 48 private: | 48 private: |
| 49 base::HistogramTester histogram_tester_; | 49 base::HistogramTester histogram_tester_; |
| 50 | 50 |
| 51 DISALLOW_COPY_AND_ASSIGN(LogWebUIUrlTest); | 51 DISALLOW_COPY_AND_ASSIGN(LogWebUIUrlTest); |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 IN_PROC_BROWSER_TEST_F(LogWebUIUrlTest, TestHistoryFrame) { | 54 IN_PROC_BROWSER_TEST_F(LogWebUIUrlTest, TestHistoryFrame) { |
| 55 GURL history_frame_url(chrome::kChromeUIHistoryFrameURL); | 55 GURL history_frame_url(chrome::kChromeUIHistoryFrameURL); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 uint32_t extensions_frame_url_hash = base::Hash(extensions_frame_url.spec()); | 116 uint32_t extensions_frame_url_hash = base::Hash(extensions_frame_url.spec()); |
| 117 | 117 |
| 118 EXPECT_THAT(GetSamples(), ElementsAre(Bucket(extensions_frame_url_hash, 1), | 118 EXPECT_THAT(GetSamples(), ElementsAre(Bucket(extensions_frame_url_hash, 1), |
| 119 Bucket(history_frame_url_hash, 2), | 119 Bucket(history_frame_url_hash, 2), |
| 120 Bucket(uber_frame_url_hash, 2), | 120 Bucket(uber_frame_url_hash, 2), |
| 121 Bucket(uber_url_hash, 2))); | 121 Bucket(uber_url_hash, 2))); |
| 122 } | 122 } |
| 123 #endif | 123 #endif |
| 124 | 124 |
| 125 } // namespace webui | 125 } // namespace webui |
| OLD | NEW |