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

Side by Side Diff: chrome/browser/metrics/chrome_browser_main_extra_parts_metrics_unittest.cc

Issue 1608733002: Remove ui/gfx/screen_type_delegate.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-4
Patch Set: GetNativeScreen Created 4 years, 11 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 unified diff | Download patch
OLDNEW
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/metrics/chrome_browser_main_extra_parts_metrics.h" 5 #include "chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/test/histogram_tester.h" 10 #include "base/test/histogram_tester.h"
(...skipping 24 matching lines...) Expand all
35 base::MessageLoop message_loop_; 35 base::MessageLoop message_loop_;
36 36
37 // Dummy screen required by a ChromeBrowserMainExtraPartsMetrics test target. 37 // Dummy screen required by a ChromeBrowserMainExtraPartsMetrics test target.
38 gfx::test::TestScreen test_screen_; 38 gfx::test::TestScreen test_screen_;
39 39
40 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainExtraPartsMetricsTest); 40 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainExtraPartsMetricsTest);
41 }; 41 };
42 42
43 ChromeBrowserMainExtraPartsMetricsTest::ChromeBrowserMainExtraPartsMetricsTest() 43 ChromeBrowserMainExtraPartsMetricsTest::ChromeBrowserMainExtraPartsMetricsTest()
44 : device_data_manager_test_api_() { 44 : device_data_manager_test_api_() {
45 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, &test_screen_); 45 gfx::Screen::SetScreenInstance(&test_screen_);
46 } 46 }
47 47
48 ChromeBrowserMainExtraPartsMetricsTest:: 48 ChromeBrowserMainExtraPartsMetricsTest::
49 ~ChromeBrowserMainExtraPartsMetricsTest() { 49 ~ChromeBrowserMainExtraPartsMetricsTest() {
50 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, nullptr); 50 gfx::Screen::SetScreenInstance(nullptr);
51 } 51 }
52 52
53 // Verify a TouchEventsEnabled value isn't recorded during construction. 53 // Verify a TouchEventsEnabled value isn't recorded during construction.
54 TEST_F(ChromeBrowserMainExtraPartsMetricsTest, 54 TEST_F(ChromeBrowserMainExtraPartsMetricsTest,
55 VerifyTouchEventsEnabledIsNotRecordedAfterConstruction) { 55 VerifyTouchEventsEnabledIsNotRecordedAfterConstruction) {
56 base::HistogramTester histogram_tester; 56 base::HistogramTester histogram_tester;
57 ChromeBrowserMainExtraPartsMetrics test_target; 57 ChromeBrowserMainExtraPartsMetrics test_target;
58 histogram_tester.ExpectTotalCount(kTouchEventsEnabledHistogramName, 0); 58 histogram_tester.ExpectTotalCount(kTouchEventsEnabledHistogramName, 0);
59 } 59 }
60 60
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 TEST_F(ChromeBrowserMainExtraPartsMetricsTest, 117 TEST_F(ChromeBrowserMainExtraPartsMetricsTest,
118 VerifyTouchEventsEnabledIsRecordedAfterPostBrowserStart) { 118 VerifyTouchEventsEnabledIsRecordedAfterPostBrowserStart) {
119 base::HistogramTester histogram_tester; 119 base::HistogramTester histogram_tester;
120 ChromeBrowserMainExtraPartsMetrics test_target; 120 ChromeBrowserMainExtraPartsMetrics test_target;
121 121
122 test_target.PostBrowserStart(); 122 test_target.PostBrowserStart();
123 histogram_tester.ExpectTotalCount(kTouchEventsEnabledHistogramName, 1); 123 histogram_tester.ExpectTotalCount(kTouchEventsEnabledHistogramName, 1);
124 } 124 }
125 125
126 #endif // defined(USE_OZONE) || defined(USE_X11) 126 #endif // defined(USE_OZONE) || defined(USE_X11)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698