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 cc5a7e826cac304855e70566342bad83cad03da0..9eb03c699042dc3f2c7e054bb50f2aae0335fa0c 100644 |
--- a/content/renderer/screen_orientation/screen_orientation_dispatcher_unittest.cc |
+++ b/content/renderer/screen_orientation/screen_orientation_dispatcher_unittest.cc |
@@ -32,19 +32,14 @@ class MockLockOrientationCallback : |
bool succeeded_; |
bool failed_; |
- unsigned angle_; |
- blink::WebScreenOrientationType orientation_; |
blink::WebLockOrientationError error_; |
}; |
explicit MockLockOrientationCallback(LockOrientationResultHolder* results) |
: results_(results) {} |
- virtual void onSuccess(unsigned angle, |
- blink::WebScreenOrientationType orientation) { |
+ virtual void onSuccess() { |
results_->succeeded_ = true; |
- results_->angle_ = angle; |
- results_->orientation_ = orientation; |
} |
virtual void onError(blink::WebLockOrientationError error) { |
@@ -170,38 +165,20 @@ TEST_F(ScreenOrientationDispatcherTest, LockRequest_Error) { |
} |
// Test that when a LockSuccess message is received, the request is set as |
-// succeeded with the correct values. |
+// succeeded. |
TEST_F(ScreenOrientationDispatcherTest, LockRequest_Success) { |
- struct ScreenOrientationInformation { |
- unsigned angle; |
- blink::WebScreenOrientationType type; |
- } orientations[] = { |
- { 0, blink::WebScreenOrientationPortraitPrimary }, |
- { 0, blink::WebScreenOrientationLandscapePrimary }, |
- { 90, blink::WebScreenOrientationPortraitSecondary }, |
- { 90, blink::WebScreenOrientationLandscapePrimary } |
- }; |
- |
- int orientationsCount = 4; |
- |
- for (int i = 0; i < orientationsCount; ++i) { |
- MockLockOrientationCallback::LockOrientationResultHolder callback_results; |
- LockOrientation(blink::WebScreenOrientationLockPortraitPrimary, |
- new MockLockOrientationCallback(&callback_results)); |
+ MockLockOrientationCallback::LockOrientationResultHolder callback_results; |
+ LockOrientation(blink::WebScreenOrientationLockPortraitPrimary, |
+ new MockLockOrientationCallback(&callback_results)); |
- int request_id = GetFirstLockRequestIdFromSink(); |
- OnMessageReceived(ScreenOrientationMsg_LockSuccess(routing_id(), |
- request_id, |
- orientations[i].angle, |
- orientations[i].type)); |
+ int request_id = GetFirstLockRequestIdFromSink(); |
+ OnMessageReceived(ScreenOrientationMsg_LockSuccess(routing_id(), |
+ request_id)); |
- EXPECT_TRUE(callback_results.succeeded_); |
- EXPECT_FALSE(callback_results.failed_); |
- EXPECT_EQ(orientations[i].angle, callback_results.angle_); |
- EXPECT_EQ(orientations[i].type, callback_results.orientation_); |
+ EXPECT_TRUE(callback_results.succeeded_); |
+ EXPECT_FALSE(callback_results.failed_); |
- sink().ClearMessages(); |
- } |
+ sink().ClearMessages(); |
} |
// Test an edge case: a LockSuccess is received but it matches no pending |
@@ -212,11 +189,8 @@ TEST_F(ScreenOrientationDispatcherTest, SuccessForUnknownRequest) { |
new MockLockOrientationCallback(&callback_results)); |
int request_id = GetFirstLockRequestIdFromSink(); |
- OnMessageReceived(ScreenOrientationMsg_LockSuccess( |
- routing_id(), |
- request_id + 1, |
- 90, |
- blink::WebScreenOrientationLandscapePrimary)); |
+ OnMessageReceived(ScreenOrientationMsg_LockSuccess(routing_id(), |
+ request_id + 1)); |
EXPECT_FALSE(callback_results.succeeded_); |
EXPECT_FALSE(callback_results.failed_); |
@@ -256,11 +230,8 @@ TEST_F(ScreenOrientationDispatcherTest, RaceScenario) { |
// callback_results1 must be rejected, tested in CancelPending_DoubleLock. |
- OnMessageReceived(ScreenOrientationMsg_LockSuccess( |
- routing_id(), |
- request_id1, |
- 0, |
- blink::WebScreenOrientationPortraitPrimary)); |
+ OnMessageReceived(ScreenOrientationMsg_LockSuccess(routing_id(), |
+ request_id1)); |
// First request is still rejected. |
EXPECT_FALSE(callback_results1.succeeded_); |