| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/test/ash_test_helper.h" | 5 #include "ash/test/ash_test_helper.h" |
| 6 | 6 |
| 7 #include "ash/test/ash_test_environment.h" | 7 #include "ash/test/ash_test_environment.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 #include "ui/aura/window_event_dispatcher.h" | 9 #include "ui/aura/window_event_dispatcher.h" |
| 10 #include "ui/views/widget/widget.h" | 10 #include "ui/views/widget/widget.h" |
| 11 | 11 |
| 12 namespace ash { | 12 namespace ash { |
| 13 | 13 |
| 14 // Tests for AshTestHelper. Who will watch the watchers? And who will test | 14 // Tests for AshTestHelper. Who will watch the watchers? And who will test |
| 15 // the tests? | 15 // the tests? |
| 16 class AshTestHelperTest : public testing::Test { | 16 class AshTestHelperTest : public testing::Test { |
| 17 public: | 17 public: |
| 18 AshTestHelperTest() {} | 18 AshTestHelperTest() {} |
| 19 ~AshTestHelperTest() override {} | 19 ~AshTestHelperTest() override {} |
| 20 | 20 |
| 21 void SetUp() override { | 21 void SetUp() override { |
| 22 testing::Test::SetUp(); | 22 testing::Test::SetUp(); |
| 23 ash_test_environment_ = test::AshTestEnvironment::Create(); | 23 ash_test_environment_ = test::AshTestEnvironment::Create(); |
| 24 ash_test_helper_.reset( | 24 ash_test_helper_.reset( |
| 25 new test::AshTestHelper(ash_test_environment_.get())); | 25 new test::AshTestHelper(ash_test_environment_.get())); |
| 26 ash_test_helper_->SetUp(true, | 26 ash_test_helper_->SetUp(true); |
| 27 MaterialDesignController::Mode::UNINITIALIZED); | |
| 28 } | 27 } |
| 29 | 28 |
| 30 void TearDown() override { | 29 void TearDown() override { |
| 31 ash_test_helper_->TearDown(); | 30 ash_test_helper_->TearDown(); |
| 32 testing::Test::TearDown(); | 31 testing::Test::TearDown(); |
| 33 } | 32 } |
| 34 | 33 |
| 35 test::AshTestHelper* ash_test_helper() { return ash_test_helper_.get(); } | 34 test::AshTestHelper* ash_test_helper() { return ash_test_helper_.get(); } |
| 36 | 35 |
| 37 protected: | 36 protected: |
| (...skipping 17 matching lines...) Expand all Loading... |
| 55 Widget::InitParams params; | 54 Widget::InitParams params; |
| 56 params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 55 params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
| 57 params.context = ash_test_helper()->CurrentContext(); | 56 params.context = ash_test_helper()->CurrentContext(); |
| 58 w1->Init(params); | 57 w1->Init(params); |
| 59 w1->Show(); | 58 w1->Show(); |
| 60 EXPECT_TRUE(w1->IsActive()); | 59 EXPECT_TRUE(w1->IsActive()); |
| 61 EXPECT_TRUE(w1->IsVisible()); | 60 EXPECT_TRUE(w1->IsVisible()); |
| 62 } | 61 } |
| 63 | 62 |
| 64 } // namespace ash | 63 } // namespace ash |
| OLD | NEW |