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

Side by Side Diff: services/ui/display/platform_screen_ozone_unittests.cc

Issue 2503923003: Demonstrate external-window-mode in mus-demo (Closed)
Patch Set: Wrap comment Created 4 years 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 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 } 187 }
188 188
189 // testing::Test: 189 // testing::Test:
190 void SetUp() override { 190 void SetUp() override {
191 base::CommandLine::ForCurrentProcess()->AppendSwitchNative( 191 base::CommandLine::ForCurrentProcess()->AppendSwitchNative(
192 switches::kScreenConfig, "none"); 192 switches::kScreenConfig, "none");
193 193
194 testing::Test::SetUp(); 194 testing::Test::SetUp();
195 ui::OzonePlatform::InitializeForUI(); 195 ui::OzonePlatform::InitializeForUI();
196 platform_screen_ = base::MakeUnique<PlatformScreenOzone>(); 196 platform_screen_ = base::MakeUnique<PlatformScreenOzone>();
197 platform_screen_->Init(&delegate_); 197 platform_screen_->Init(&delegate_, PlatformScreen::WINDOW_MODE_INTERNAL);
198 198
199 // Have all tests start with a 1024x768 display by default. 199 // Have all tests start with a 1024x768 display by default.
200 AddDisplay(1, gfx::Size(1024, 768)); 200 AddDisplay(1, gfx::Size(1024, 768));
201 TriggerOnDisplayModeChanged(); 201 TriggerOnDisplayModeChanged();
202 202
203 // Double check the expected display exists and clear counters. 203 // Double check the expected display exists and clear counters.
204 ASSERT_THAT(delegate()->added(), SizeIs(1)); 204 ASSERT_THAT(delegate()->added(), SizeIs(1));
205 ASSERT_THAT(delegate_.added()[0], DisplayId(1)); 205 ASSERT_THAT(delegate_.added()[0], DisplayId(1));
206 ASSERT_THAT(delegate_.added()[0], DisplayOrigin("0,0")); 206 ASSERT_THAT(delegate_.added()[0], DisplayOrigin("0,0"));
207 ASSERT_THAT(delegate_.added()[0], DisplaySize("1024x768")); 207 ASSERT_THAT(delegate_.added()[0], DisplaySize("1024x768"));
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 EXPECT_EQ("Added(2);Added(3)", delegate()->changes()); 341 EXPECT_EQ("Added(2);Added(3)", delegate()->changes());
342 delegate()->Reset(); 342 delegate()->Reset();
343 343
344 platform_screen()->SwapPrimaryDisplay(); 344 platform_screen()->SwapPrimaryDisplay();
345 platform_screen()->SwapPrimaryDisplay(); 345 platform_screen()->SwapPrimaryDisplay();
346 platform_screen()->SwapPrimaryDisplay(); 346 platform_screen()->SwapPrimaryDisplay();
347 EXPECT_EQ("Primary(2);Primary(3);Primary(1)", delegate()->changes()); 347 EXPECT_EQ("Primary(2);Primary(3);Primary(1)", delegate()->changes());
348 } 348 }
349 349
350 } // namespace display 350 } // namespace display
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698