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

Side by Side Diff: ui/display/chromeos/x11/native_display_event_dispatcher_x11_unittest.cc

Issue 1178423008: Provision to start base::SimpleTestTickClock at initial ticks Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 11 months 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/chromeos/touch_exploration_controller_unittest.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 <stdint.h> 5 #include <stdint.h>
6 #include <X11/extensions/Xrandr.h> 6 #include <X11/extensions/Xrandr.h>
7 7
8 #undef Bool 8 #undef Bool
9 #undef None 9 #undef None
10 10
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 129
130 private: 130 private:
131 DISALLOW_COPY_AND_ASSIGN(NativeDisplayEventDispatcherX11Test); 131 DISALLOW_COPY_AND_ASSIGN(NativeDisplayEventDispatcherX11Test);
132 }; 132 };
133 133
134 NativeDisplayEventDispatcherX11Test::NativeDisplayEventDispatcherX11Test() 134 NativeDisplayEventDispatcherX11Test::NativeDisplayEventDispatcherX11Test()
135 : xrandr_event_base_(10), 135 : xrandr_event_base_(10),
136 helper_delegate_(new TestHelperDelegate()), 136 helper_delegate_(new TestHelperDelegate()),
137 dispatcher_(new NativeDisplayEventDispatcherX11(helper_delegate_.get(), 137 dispatcher_(new NativeDisplayEventDispatcherX11(helper_delegate_.get(),
138 xrandr_event_base_)), 138 xrandr_event_base_)),
139 test_tick_clock_(new base::SimpleTestTickClock) { 139 test_tick_clock_(new base::SimpleTestTickClock(
140 test_tick_clock_->Advance(base::TimeDelta::FromMilliseconds(1)); 140 base::TimeTicks() + base::TimeDelta::FromMilliseconds(1))) {
141 dispatcher_->SetTickClockForTest( 141 dispatcher_->SetTickClockForTest(
142 scoped_ptr<base::TickClock>(test_tick_clock_)); 142 scoped_ptr<base::TickClock>(test_tick_clock_));
143 } 143 }
144 144
145 NativeDisplayEventDispatcherX11Test::~NativeDisplayEventDispatcherX11Test() {} 145 NativeDisplayEventDispatcherX11Test::~NativeDisplayEventDispatcherX11Test() {}
146 146
147 void NativeDisplayEventDispatcherX11Test::DispatchScreenChangeEvent() { 147 void NativeDisplayEventDispatcherX11Test::DispatchScreenChangeEvent() {
148 XRRScreenChangeNotifyEvent event = {0}; 148 XRRScreenChangeNotifyEvent event = {0};
149 event.type = xrandr_event_base_ + RRScreenChangeNotify; 149 event.type = xrandr_event_base_ + RRScreenChangeNotify;
150 150
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 outputs.clear(); 320 outputs.clear();
321 outputs.push_back(CreateOutput(0, DISPLAY_CONNECTION_TYPE_UNKNOWN, 2, 11)); 321 outputs.push_back(CreateOutput(0, DISPLAY_CONNECTION_TYPE_UNKNOWN, 2, 11));
322 helper_delegate_->set_cached_outputs(outputs.get()); 322 helper_delegate_->set_cached_outputs(outputs.get());
323 323
324 // External display should be updated if the id is zero. 324 // External display should be updated if the id is zero.
325 DispatchOutputChangeEvent(2, 11, 20, true); 325 DispatchOutputChangeEvent(2, 11, 20, true);
326 EXPECT_EQ(1, helper_delegate_->num_calls_notify_observers()); 326 EXPECT_EQ(1, helper_delegate_->num_calls_notify_observers());
327 } 327 }
328 328
329 } // namespace ui 329 } // namespace ui
OLDNEW
« no previous file with comments | « ui/chromeos/touch_exploration_controller_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698