| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |