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

Unified Diff: ui/display/manager/chromeos/x11/native_display_event_dispatcher_x11_unittest.cc

Issue 2540313002: Split //ui/display and create //ui/display/manager. (Closed)
Patch Set: Cleanup export header. 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 side-by-side diff with in-line comments
Download patch
Index: ui/display/manager/chromeos/x11/native_display_event_dispatcher_x11_unittest.cc
diff --git a/ui/display/chromeos/x11/native_display_event_dispatcher_x11_unittest.cc b/ui/display/manager/chromeos/x11/native_display_event_dispatcher_x11_unittest.cc
similarity index 89%
rename from ui/display/chromeos/x11/native_display_event_dispatcher_x11_unittest.cc
rename to ui/display/manager/chromeos/x11/native_display_event_dispatcher_x11_unittest.cc
index 5dda0a6b3ef007ffe51a99e4b0ec986ba421c2ee..76e7ac22e40c3426c2fa29da2de8e49159bfabb3 100644
--- a/ui/display/chromeos/x11/native_display_event_dispatcher_x11_unittest.cc
+++ b/ui/display/manager/chromeos/x11/native_display_event_dispatcher_x11_unittest.cc
@@ -11,10 +11,10 @@
#include "base/macros.h"
#include "base/test/simple_test_tick_clock.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "ui/display/chromeos/x11/display_mode_x11.h"
-#include "ui/display/chromeos/x11/display_snapshot_x11.h"
-#include "ui/display/chromeos/x11/native_display_delegate_x11.h"
-#include "ui/display/chromeos/x11/native_display_event_dispatcher_x11.h"
+#include "ui/display/manager/chromeos/x11/display_mode_x11.h"
+#include "ui/display/manager/chromeos/x11/display_snapshot_x11.h"
+#include "ui/display/manager/chromeos/x11/native_display_delegate_x11.h"
+#include "ui/display/manager/chromeos/x11/native_display_event_dispatcher_x11.h"
namespace ui {
@@ -24,9 +24,7 @@ DisplaySnapshotX11* CreateOutput(int64_t id,
DisplayConnectionType type,
RROutput output,
RRCrtc crtc) {
- static const DisplayModeX11 kDefaultDisplayMode(gfx::Size(1, 1),
- false,
- 60.0f,
+ static const DisplayModeX11 kDefaultDisplayMode(gfx::Size(1, 1), false, 60.0f,
20);
std::vector<std::unique_ptr<const DisplayMode>> modes;
const DisplayMode* mode;
@@ -35,36 +33,19 @@ DisplaySnapshotX11* CreateOutput(int64_t id,
mode = modes.front().get();
DisplaySnapshotX11* snapshot = new DisplaySnapshotX11(
- id,
- gfx::Point(0, 0),
- gfx::Size(0, 0),
- type,
- false,
- false,
- std::string(),
- std::move(modes),
- std::vector<uint8_t>(),
- mode,
- NULL,
- output,
- crtc,
- 0);
+ id, gfx::Point(0, 0), gfx::Size(0, 0), type, false, false, std::string(),
+ std::move(modes), std::vector<uint8_t>(), mode, NULL, output, crtc, 0);
return snapshot;
}
DisplaySnapshotX11* CreateExternalOutput(RROutput output, RRCrtc crtc) {
return CreateOutput(static_cast<int64_t>(output),
- DISPLAY_CONNECTION_TYPE_UNKNOWN,
- output,
- crtc);
+ DISPLAY_CONNECTION_TYPE_UNKNOWN, output, crtc);
}
DisplaySnapshotX11* CreateInternalOutput(RROutput output, RRCrtc crtc) {
- return CreateOutput(0,
- DISPLAY_CONNECTION_TYPE_INTERNAL,
- output,
- crtc);
+ return CreateOutput(0, DISPLAY_CONNECTION_TYPE_INTERNAL, output, crtc);
}
class TestHelperDelegate : public NativeDisplayDelegateX11::HelperDelegate {
@@ -266,8 +247,7 @@ TEST_F(NativeDisplayEventDispatcherX11Test,
EXPECT_EQ(1, helper_delegate_->num_calls_notify_observers());
}
-TEST_F(NativeDisplayEventDispatcherX11Test,
- ForceUpdateAfterCacheExpiration) {
+TEST_F(NativeDisplayEventDispatcherX11Test, ForceUpdateAfterCacheExpiration) {
// +1 to compenstate a possible rounding error.
const int kHalfOfExpirationMs =
NativeDisplayEventDispatcherX11::kUseCacheAfterStartupMs / 2 + 1;
@@ -283,8 +263,8 @@ TEST_F(NativeDisplayEventDispatcherX11Test,
DispatchOutputChangeEvent(2, 11, 20, true);
EXPECT_EQ(0, helper_delegate_->num_calls_notify_observers());
- test_tick_clock_->Advance(base::TimeDelta::FromMilliseconds(
- kHalfOfExpirationMs));
+ test_tick_clock_->Advance(
+ base::TimeDelta::FromMilliseconds(kHalfOfExpirationMs));
// Duplicated event will still be ignored.
DispatchOutputChangeEvent(2, 11, 20, true);
@@ -302,8 +282,8 @@ TEST_F(NativeDisplayEventDispatcherX11Test,
EXPECT_EQ(2, helper_delegate_->num_calls_notify_observers());
// Advancing time further should not change the behavior.
- test_tick_clock_->Advance(base::TimeDelta::FromMilliseconds(
- kHalfOfExpirationMs));
+ test_tick_clock_->Advance(
+ base::TimeDelta::FromMilliseconds(kHalfOfExpirationMs));
DispatchOutputChangeEvent(2, 11, 20, true);
EXPECT_EQ(3, helper_delegate_->num_calls_notify_observers());
@@ -313,8 +293,7 @@ TEST_F(NativeDisplayEventDispatcherX11Test,
EXPECT_EQ(4, helper_delegate_->num_calls_notify_observers());
}
-TEST_F(NativeDisplayEventDispatcherX11Test,
- UpdateMissingExternalDisplayId) {
+TEST_F(NativeDisplayEventDispatcherX11Test, UpdateMissingExternalDisplayId) {
ScopedVector<DisplaySnapshot> outputs;
outputs.push_back(CreateInternalOutput(1, 10));
helper_delegate_->set_cached_outputs(outputs.get());
« no previous file with comments | « ui/display/manager/chromeos/x11/native_display_event_dispatcher_x11.cc ('k') | ui/display/manager/display_layout.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698