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

Unified Diff: content/renderer/screen_orientation/screen_orientation_dispatcher_unittest.cc

Issue 327573002: Properly route screen orientation IPC messages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@screen_lock_view
Patch Set: review comments Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/screen_orientation/screen_orientation_dispatcher.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/screen_orientation/screen_orientation_dispatcher_unittest.cc
diff --git a/content/renderer/screen_orientation/screen_orientation_dispatcher_unittest.cc b/content/renderer/screen_orientation/screen_orientation_dispatcher_unittest.cc
index 2bc542bc8f3e11f3731503bd5d1ad8c0b4bfe72b..461533e6304229baf702bf72ffad578508968462 100644
--- a/content/renderer/screen_orientation/screen_orientation_dispatcher_unittest.cc
+++ b/content/renderer/screen_orientation/screen_orientation_dispatcher_unittest.cc
@@ -105,6 +105,11 @@ class ScreenOrientationDispatcherTest : public testing::Test {
dispatcher_->OnMessageReceived(message);
}
+ int routing_id() const {
+ // We return a fake routing_id() in the context of this test.
+ return 0;
+ }
+
IPC::TestSink sink_;
scoped_ptr<ScreenOrientationDispatcher> dispatcher_;
};
@@ -156,7 +161,8 @@ TEST_F(ScreenOrientationDispatcherTest, LockRequest_Error) {
new MockLockOrientationCallback(&callback_results));
int request_id = GetFirstLockRequestIdFromSink();
- OnMessageReceived(ScreenOrientationMsg_LockError(request_id, *it));
+ OnMessageReceived(
+ ScreenOrientationMsg_LockError(routing_id(), request_id, *it));
EXPECT_FALSE(callback_results.succeeded_);
EXPECT_TRUE(callback_results.failed_);
@@ -187,7 +193,8 @@ TEST_F(ScreenOrientationDispatcherTest, LockRequest_Success) {
new MockLockOrientationCallback(&callback_results));
int request_id = GetFirstLockRequestIdFromSink();
- OnMessageReceived(ScreenOrientationMsg_LockSuccess(request_id,
+ OnMessageReceived(ScreenOrientationMsg_LockSuccess(routing_id(),
+ request_id,
orientations[i].angle,
orientations[i].type));
@@ -209,6 +216,7 @@ TEST_F(ScreenOrientationDispatcherTest, SuccessForUnknownRequest) {
int request_id = GetFirstLockRequestIdFromSink();
OnMessageReceived(ScreenOrientationMsg_LockSuccess(
+ routing_id(),
request_id + 1,
90,
blink::WebScreenOrientationLandscapePrimary));
@@ -226,6 +234,7 @@ TEST_F(ScreenOrientationDispatcherTest, ErrorForUnknownRequest) {
int request_id = GetFirstLockRequestIdFromSink();
OnMessageReceived(ScreenOrientationMsg_LockError(
+ routing_id(),
request_id + 1,
blink::WebLockOrientationCallback::ErrorTypeCanceled));
@@ -253,6 +262,7 @@ TEST_F(ScreenOrientationDispatcherTest, RaceScenario) {
// callback_results1 must be rejected, tested in CancelPending_DoubleLock.
OnMessageReceived(ScreenOrientationMsg_LockSuccess(
+ routing_id(),
request_id1,
0,
blink::WebScreenOrientationPortraitPrimary));
« no previous file with comments | « content/renderer/screen_orientation/screen_orientation_dispatcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698