| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/debug/leak_annotations.h" | 9 #include "base/debug/leak_annotations.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 | 135 |
| 136 class SystemDisplayApiTest : public ShellApiTest { | 136 class SystemDisplayApiTest : public ShellApiTest { |
| 137 public: | 137 public: |
| 138 SystemDisplayApiTest() | 138 SystemDisplayApiTest() |
| 139 : provider_(new MockDisplayInfoProvider), screen_(new MockScreen) {} | 139 : provider_(new MockDisplayInfoProvider), screen_(new MockScreen) {} |
| 140 | 140 |
| 141 ~SystemDisplayApiTest() override {} | 141 ~SystemDisplayApiTest() override {} |
| 142 | 142 |
| 143 void SetUpOnMainThread() override { | 143 void SetUpOnMainThread() override { |
| 144 ShellApiTest::SetUpOnMainThread(); | 144 ShellApiTest::SetUpOnMainThread(); |
| 145 ANNOTATE_LEAKING_OBJECT_PTR( | 145 ANNOTATE_LEAKING_OBJECT_PTR(gfx::Screen::GetScreen()); |
| 146 gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_NATIVE)); | 146 gfx::Screen::SetScreenInstance(screen_.get()); |
| 147 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get()); | |
| 148 DisplayInfoProvider::InitializeForTesting(provider_.get()); | 147 DisplayInfoProvider::InitializeForTesting(provider_.get()); |
| 149 } | 148 } |
| 150 | 149 |
| 151 protected: | 150 protected: |
| 152 scoped_ptr<MockDisplayInfoProvider> provider_; | 151 scoped_ptr<MockDisplayInfoProvider> provider_; |
| 153 scoped_ptr<gfx::Screen> screen_; | 152 scoped_ptr<gfx::Screen> screen_; |
| 154 | 153 |
| 155 private: | 154 private: |
| 156 DISALLOW_COPY_AND_ASSIGN(SystemDisplayApiTest); | 155 DISALLOW_COPY_AND_ASSIGN(SystemDisplayApiTest); |
| 157 }; | 156 }; |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 enable_unified_function->set_extension(test_extension.get()); | 295 enable_unified_function->set_extension(test_extension.get()); |
| 297 ASSERT_TRUE(api_test_utils::RunFunction(enable_unified_function.get(), | 296 ASSERT_TRUE(api_test_utils::RunFunction(enable_unified_function.get(), |
| 298 "[false]", browser_context())); | 297 "[false]", browser_context())); |
| 299 EXPECT_FALSE(provider_->unified_desktop_enabled()); | 298 EXPECT_FALSE(provider_->unified_desktop_enabled()); |
| 300 } | 299 } |
| 301 } | 300 } |
| 302 | 301 |
| 303 #endif // defined(OS_CHROMEOS) | 302 #endif // defined(OS_CHROMEOS) |
| 304 | 303 |
| 305 } // namespace extensions | 304 } // namespace extensions |
| OLD | NEW |