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

Side by Side Diff: ui/display/chromeos/display_configurator_unittest.cc

Issue 2498103002: Fix potential GPU crash caused by VT switching (Closed)
Patch Set: Add doc Created 4 years, 1 month 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
« no previous file with comments | « ui/display/chromeos/display_configurator.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/display/chromeos/display_configurator.h" 5 #include "ui/display/chromeos/display_configurator.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 1722 matching lines...) Expand 10 before | Expand all | Expand 10 after
1733 log_->GetActionsAndClear()); 1733 log_->GetActionsAndClear());
1734 } 1734 }
1735 1735
1736 TEST_F(DisplayConfiguratorTest, ExternalControl) { 1736 TEST_F(DisplayConfiguratorTest, ExternalControl) {
1737 InitWithSingleOutput(); 1737 InitWithSingleOutput();
1738 state_controller_.set_state(MULTIPLE_DISPLAY_STATE_SINGLE); 1738 state_controller_.set_state(MULTIPLE_DISPLAY_STATE_SINGLE);
1739 configurator_.RelinquishControl( 1739 configurator_.RelinquishControl(
1740 base::Bind(&DisplayConfiguratorTest::OnDisplayControlUpdated, 1740 base::Bind(&DisplayConfiguratorTest::OnDisplayControlUpdated,
1741 base::Unretained(this))); 1741 base::Unretained(this)));
1742 EXPECT_EQ(CALLBACK_SUCCESS, PopDisplayControlResult()); 1742 EXPECT_EQ(CALLBACK_SUCCESS, PopDisplayControlResult());
1743 EXPECT_EQ(JoinActions(kRelinquishDisplayControl, nullptr), 1743 EXPECT_EQ(
1744 log_->GetActionsAndClear()); 1744 JoinActions(
1745 kGrab,
1746 GetFramebufferAction(small_mode_.size(), outputs_[0].get(), nullptr)
1747 .c_str(),
1748 GetCrtcAction(*outputs_[0], nullptr, gfx::Point(0, 0)).c_str(),
1749 kUngrab, kRelinquishDisplayControl, nullptr),
1750 log_->GetActionsAndClear());
1745 configurator_.TakeControl( 1751 configurator_.TakeControl(
1746 base::Bind(&DisplayConfiguratorTest::OnDisplayControlUpdated, 1752 base::Bind(&DisplayConfiguratorTest::OnDisplayControlUpdated,
1747 base::Unretained(this))); 1753 base::Unretained(this)));
1748 EXPECT_EQ(CALLBACK_SUCCESS, PopDisplayControlResult()); 1754 EXPECT_EQ(CALLBACK_SUCCESS, PopDisplayControlResult());
1749 EXPECT_EQ( 1755 EXPECT_EQ(
1750 JoinActions( 1756 JoinActions(
1751 kTakeDisplayControl, kGrab, 1757 kTakeDisplayControl, kGrab,
1752 GetFramebufferAction(small_mode_.size(), outputs_[0].get(), nullptr) 1758 GetFramebufferAction(small_mode_.size(), outputs_[0].get(), nullptr)
1753 .c_str(), 1759 .c_str(),
1754 GetCrtcAction(*outputs_[0], &small_mode_, gfx::Point(0, 0)).c_str(), 1760 GetCrtcAction(*outputs_[0], &small_mode_, gfx::Point(0, 0)).c_str(),
1755 kUngrab, nullptr), 1761 kForceDPMS, kUngrab, nullptr),
1756 log_->GetActionsAndClear()); 1762 log_->GetActionsAndClear());
1757 } 1763 }
1758 1764
1759 TEST_F(DisplayConfiguratorTest, 1765 TEST_F(DisplayConfiguratorTest,
1760 SetDisplayPowerWhilePendingConfigurationTaskRunning) { 1766 SetDisplayPowerWhilePendingConfigurationTaskRunning) {
1761 // Start out with two displays in extended mode. 1767 // Start out with two displays in extended mode.
1762 state_controller_.set_state(MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED); 1768 state_controller_.set_state(MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED);
1763 Init(false); 1769 Init(false);
1764 configurator_.ForceInitialConfigure(0); 1770 configurator_.ForceInitialConfigure(0);
1765 log_->GetActionsAndClear(); 1771 log_->GetActionsAndClear();
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
2167 configurator_.ResumeDisplays(); 2173 configurator_.ResumeDisplays();
2168 EXPECT_EQ(kLongDelay, config_waiter_.Wait()); 2174 EXPECT_EQ(kLongDelay, config_waiter_.Wait());
2169 EXPECT_EQ(chromeos::DISPLAY_POWER_ALL_ON, 2175 EXPECT_EQ(chromeos::DISPLAY_POWER_ALL_ON,
2170 configurator_.current_power_state()); 2176 configurator_.current_power_state());
2171 EXPECT_EQ(MULTIPLE_DISPLAY_STATE_MULTI_EXTENDED, 2177 EXPECT_EQ(MULTIPLE_DISPLAY_STATE_MULTI_EXTENDED,
2172 configurator_.display_state()); 2178 configurator_.display_state());
2173 } 2179 }
2174 2180
2175 } // namespace test 2181 } // namespace test
2176 } // namespace ui 2182 } // namespace ui
OLDNEW
« no previous file with comments | « ui/display/chromeos/display_configurator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698