Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <memory> | 5 #include <memory> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 161 | 161 |
| 162 // Add NDD to ScreenManager so one isn't loaded from Ozone. | 162 // Add NDD to ScreenManager so one isn't loaded from Ozone. |
| 163 screen_manager_->native_display_delegate_ = std::move(ndd); | 163 screen_manager_->native_display_delegate_ = std::move(ndd); |
| 164 | 164 |
| 165 AddDisplay(FakeDisplaySnapshot::Builder() | 165 AddDisplay(FakeDisplaySnapshot::Builder() |
| 166 .SetId(1) | 166 .SetId(1) |
| 167 .SetNativeMode(gfx::Size(1024, 768)) | 167 .SetNativeMode(gfx::Size(1024, 768)) |
| 168 .SetType(DISPLAY_CONNECTION_TYPE_INTERNAL) | 168 .SetType(DISPLAY_CONNECTION_TYPE_INTERNAL) |
| 169 .Build()); | 169 .Build()); |
| 170 | 170 |
| 171 screen_manager_->Init(&delegate_); | 171 screen_manager_->Init(&delegate_, ScreenManager::WINDOW_MODE_INTERNAL); |
|
rjkroege
2017/01/23 21:19:43
This is not right in some fashion. One of the goal
fwang
2017/01/24 17:11:51
I'll check that (BTW, note that this test is only
| |
| 172 RunAllTasks(); | 172 RunAllTasks(); |
| 173 | 173 |
| 174 // Double check the expected display exists and clear counters. | 174 // Double check the expected display exists and clear counters. |
| 175 ASSERT_THAT(delegate()->added(), SizeIs(1)); | 175 ASSERT_THAT(delegate()->added(), SizeIs(1)); |
| 176 ASSERT_THAT(delegate_.added()[0], DisplayIdIs(1)); | 176 ASSERT_THAT(delegate_.added()[0], DisplayIdIs(1)); |
| 177 ASSERT_THAT(delegate_.added()[0], DisplayBoundsIs("0,0 1024x768")); | 177 ASSERT_THAT(delegate_.added()[0], DisplayBoundsIs("0,0 1024x768")); |
| 178 ASSERT_THAT(delegate_.added()[0], DisplayPixelSizeIs("1024x768")); | 178 ASSERT_THAT(delegate_.added()[0], DisplayPixelSizeIs("1024x768")); |
| 179 ASSERT_EQ("Added(1);Primary(1)", delegate()->changes()); | 179 ASSERT_EQ("Added(1);Primary(1)", delegate()->changes()); |
| 180 delegate_.Reset(); | 180 delegate_.Reset(); |
| 181 } | 181 } |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 276 | 276 |
| 277 // Swapping again should be similar and end up back with display 1 as primary. | 277 // Swapping again should be similar and end up back with display 1 as primary. |
| 278 screen_manager()->SwapPrimaryDisplay(); | 278 screen_manager()->SwapPrimaryDisplay(); |
| 279 EXPECT_EQ("Modified(1);Modified(2);Primary(1)", delegate()->changes()); | 279 EXPECT_EQ("Modified(1);Modified(2);Primary(1)", delegate()->changes()); |
| 280 EXPECT_THAT(delegate()->modified()[0], DisplayBoundsIs("0,0 1024x768")); | 280 EXPECT_THAT(delegate()->modified()[0], DisplayBoundsIs("0,0 1024x768")); |
| 281 EXPECT_THAT(delegate()->modified()[1], DisplayBoundsIs("1024,0 1024x768")); | 281 EXPECT_THAT(delegate()->modified()[1], DisplayBoundsIs("1024,0 1024x768")); |
| 282 EXPECT_EQ(1, Screen::GetScreen()->GetPrimaryDisplay().id()); | 282 EXPECT_EQ(1, Screen::GetScreen()->GetPrimaryDisplay().id()); |
| 283 } | 283 } |
| 284 | 284 |
| 285 } // namespace display | 285 } // namespace display |
| OLD | NEW |