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

Side by Side Diff: ui/display/chromeos/test/test_native_display_delegate.cc

Issue 788423002: Add display task to trigger display configuration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@async-refactor3
Patch Set: . Created 6 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 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/test/test_native_display_delegate.h" 5 #include "ui/display/chromeos/test/test_native_display_delegate.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "ui/display/chromeos/test/action_logger.h" 9 #include "ui/display/chromeos/test/action_logger.h"
10 #include "ui/display/types/display_mode.h" 10 #include "ui/display/types/display_mode.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 } 53 }
54 54
55 void TestNativeDisplayDelegate::ForceDPMSOn() { 55 void TestNativeDisplayDelegate::ForceDPMSOn() {
56 log_->AppendAction(kForceDPMS); 56 log_->AppendAction(kForceDPMS);
57 } 57 }
58 58
59 std::vector<DisplaySnapshot*> TestNativeDisplayDelegate::GetDisplays() { 59 std::vector<DisplaySnapshot*> TestNativeDisplayDelegate::GetDisplays() {
60 return outputs_; 60 return outputs_;
61 } 61 }
62 62
63 void TestNativeDisplayDelegate::GetDisplays(
64 const GetDisplaysCallback& callback) {
65 auto result = GetDisplays();
66 if (run_async_) {
67 base::MessageLoop::current()->PostTask(FROM_HERE,
68 base::Bind(callback, result));
69 } else {
70 callback.Run(result);
71 }
72 }
73
63 void TestNativeDisplayDelegate::AddMode(const DisplaySnapshot& output, 74 void TestNativeDisplayDelegate::AddMode(const DisplaySnapshot& output,
64 const DisplayMode* mode) { 75 const DisplayMode* mode) {
65 log_->AppendAction(GetAddOutputModeAction(output, mode)); 76 log_->AppendAction(GetAddOutputModeAction(output, mode));
66 } 77 }
67 78
68 bool TestNativeDisplayDelegate::Configure(const DisplaySnapshot& output, 79 bool TestNativeDisplayDelegate::Configure(const DisplaySnapshot& output,
69 const DisplayMode* mode, 80 const DisplayMode* mode,
70 const gfx::Point& origin) { 81 const gfx::Point& origin) {
71 log_->AppendAction(GetCrtcAction(output, mode, origin)); 82 log_->AppendAction(GetCrtcAction(output, mode, origin));
72 83
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 135
125 void TestNativeDisplayDelegate::AddObserver(NativeDisplayObserver* observer) { 136 void TestNativeDisplayDelegate::AddObserver(NativeDisplayObserver* observer) {
126 } 137 }
127 138
128 void TestNativeDisplayDelegate::RemoveObserver( 139 void TestNativeDisplayDelegate::RemoveObserver(
129 NativeDisplayObserver* observer) { 140 NativeDisplayObserver* observer) {
130 } 141 }
131 142
132 } // namespace test 143 } // namespace test
133 } // namespace ui 144 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698