| 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 "ash/metrics/desktop_task_switch_metric_recorder.h" | 5 #include "ash/metrics/desktop_task_switch_metric_recorder.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/test/ash_test_base.h" | 10 #include "ash/test/ash_test_base.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // Records UMA user action counts. | 60 // Records UMA user action counts. |
| 61 std::unique_ptr<base::UserActionTester> user_action_tester_; | 61 std::unique_ptr<base::UserActionTester> user_action_tester_; |
| 62 | 62 |
| 63 // The test target. | 63 // The test target. |
| 64 std::unique_ptr<DesktopTaskSwitchMetricRecorder> metrics_recorder_; | 64 std::unique_ptr<DesktopTaskSwitchMetricRecorder> metrics_recorder_; |
| 65 | 65 |
| 66 private: | 66 private: |
| 67 DISALLOW_COPY_AND_ASSIGN(DesktopTaskSwitchMetricRecorderTest); | 67 DISALLOW_COPY_AND_ASSIGN(DesktopTaskSwitchMetricRecorderTest); |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 DesktopTaskSwitchMetricRecorderTest::DesktopTaskSwitchMetricRecorderTest() { | 70 DesktopTaskSwitchMetricRecorderTest::DesktopTaskSwitchMetricRecorderTest() {} |
| 71 } | |
| 72 | 71 |
| 73 DesktopTaskSwitchMetricRecorderTest::~DesktopTaskSwitchMetricRecorderTest() { | 72 DesktopTaskSwitchMetricRecorderTest::~DesktopTaskSwitchMetricRecorderTest() {} |
| 74 } | |
| 75 | 73 |
| 76 void DesktopTaskSwitchMetricRecorderTest::SetUp() { | 74 void DesktopTaskSwitchMetricRecorderTest::SetUp() { |
| 77 test::AshTestBase::SetUp(); | 75 test::AshTestBase::SetUp(); |
| 78 metrics_recorder_.reset(new DesktopTaskSwitchMetricRecorder); | 76 metrics_recorder_.reset(new DesktopTaskSwitchMetricRecorder); |
| 79 user_action_tester_.reset(new base::UserActionTester); | 77 user_action_tester_.reset(new base::UserActionTester); |
| 80 } | 78 } |
| 81 | 79 |
| 82 void DesktopTaskSwitchMetricRecorderTest::TearDown() { | 80 void DesktopTaskSwitchMetricRecorderTest::TearDown() { |
| 83 user_action_tester_.reset(); | 81 user_action_tester_.reset(); |
| 84 metrics_recorder_.reset(); | 82 metrics_recorder_.reset(); |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 // Delegate used when creating new windows using the | 271 // Delegate used when creating new windows using the |
| 274 // CreatePositionableWindowInShellWithBounds(...) method. | 272 // CreatePositionableWindowInShellWithBounds(...) method. |
| 275 aura::test::TestWindowDelegate test_window_delegate_; | 273 aura::test::TestWindowDelegate test_window_delegate_; |
| 276 | 274 |
| 277 private: | 275 private: |
| 278 DISALLOW_COPY_AND_ASSIGN( | 276 DISALLOW_COPY_AND_ASSIGN( |
| 279 DesktopTaskSwitchMetricRecorderWithShellIntegrationTest); | 277 DesktopTaskSwitchMetricRecorderWithShellIntegrationTest); |
| 280 }; | 278 }; |
| 281 | 279 |
| 282 DesktopTaskSwitchMetricRecorderWithShellIntegrationTest:: | 280 DesktopTaskSwitchMetricRecorderWithShellIntegrationTest:: |
| 283 DesktopTaskSwitchMetricRecorderWithShellIntegrationTest() { | 281 DesktopTaskSwitchMetricRecorderWithShellIntegrationTest() {} |
| 284 } | |
| 285 | 282 |
| 286 DesktopTaskSwitchMetricRecorderWithShellIntegrationTest:: | 283 DesktopTaskSwitchMetricRecorderWithShellIntegrationTest:: |
| 287 ~DesktopTaskSwitchMetricRecorderWithShellIntegrationTest() { | 284 ~DesktopTaskSwitchMetricRecorderWithShellIntegrationTest() {} |
| 288 } | |
| 289 | 285 |
| 290 void DesktopTaskSwitchMetricRecorderWithShellIntegrationTest::SetUp() { | 286 void DesktopTaskSwitchMetricRecorderWithShellIntegrationTest::SetUp() { |
| 291 test::AshTestBase::SetUp(); | 287 test::AshTestBase::SetUp(); |
| 292 user_action_tester_.reset(new base::UserActionTester); | 288 user_action_tester_.reset(new base::UserActionTester); |
| 293 } | 289 } |
| 294 | 290 |
| 295 void DesktopTaskSwitchMetricRecorderWithShellIntegrationTest::TearDown() { | 291 void DesktopTaskSwitchMetricRecorderWithShellIntegrationTest::TearDown() { |
| 296 user_action_tester_.reset(); | 292 user_action_tester_.reset(); |
| 297 test::AshTestBase::TearDown(); | 293 test::AshTestBase::TearDown(); |
| 298 } | 294 } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 CreatePositionableWindowInShellWithBounds(gfx::Rect(0, 0, 10, 10)); | 326 CreatePositionableWindowInShellWithBounds(gfx::Rect(0, 0, 10, 10)); |
| 331 | 327 |
| 332 Shell::GetInstance()->activation_client()->ActivateWindow( | 328 Shell::GetInstance()->activation_client()->ActivateWindow( |
| 333 positionable_window); | 329 positionable_window); |
| 334 | 330 |
| 335 EXPECT_EQ(0, GetActionCount()); | 331 EXPECT_EQ(0, GetActionCount()); |
| 336 } | 332 } |
| 337 | 333 |
| 338 } // namespace | 334 } // namespace |
| 339 } // namespace ash | 335 } // namespace ash |
| OLD | NEW |