| 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 "content/renderer/screen_orientation/screen_orientation_dispatcher.h" | 5 #include "content/renderer/screen_orientation/screen_orientation_dispatcher.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <tuple> | 9 #include <tuple> |
| 10 | 10 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 EXPECT_TRUE(callback_results.failed_); | 132 EXPECT_TRUE(callback_results.failed_); |
| 133 EXPECT_EQ(blink::WebLockOrientationErrorCanceled, callback_results.error_); | 133 EXPECT_EQ(blink::WebLockOrientationErrorCanceled, callback_results.error_); |
| 134 } | 134 } |
| 135 | 135 |
| 136 // Test that when a LockError message is received, the request is set as failed | 136 // Test that when a LockError message is received, the request is set as failed |
| 137 // with the correct values. | 137 // with the correct values. |
| 138 TEST_F(ScreenOrientationDispatcherTest, LockRequest_Error) { | 138 TEST_F(ScreenOrientationDispatcherTest, LockRequest_Error) { |
| 139 std::list<blink::WebLockOrientationError> errors; | 139 std::list<blink::WebLockOrientationError> errors; |
| 140 errors.push_back(blink::WebLockOrientationErrorNotAvailable); | 140 errors.push_back(blink::WebLockOrientationErrorNotAvailable); |
| 141 errors.push_back( | 141 errors.push_back( |
| 142 blink::WebLockOrientationErrorFullScreenRequired); | 142 blink::WebLockOrientationErrorFullscreenRequired); |
| 143 errors.push_back(blink::WebLockOrientationErrorCanceled); | 143 errors.push_back(blink::WebLockOrientationErrorCanceled); |
| 144 | 144 |
| 145 for (std::list<blink::WebLockOrientationError>::const_iterator | 145 for (std::list<blink::WebLockOrientationError>::const_iterator |
| 146 it = errors.begin(); it != errors.end(); ++it) { | 146 it = errors.begin(); it != errors.end(); ++it) { |
| 147 MockLockOrientationCallback::LockOrientationResultHolder callback_results; | 147 MockLockOrientationCallback::LockOrientationResultHolder callback_results; |
| 148 LockOrientation(blink::WebScreenOrientationLockPortraitPrimary, | 148 LockOrientation(blink::WebScreenOrientationLockPortraitPrimary, |
| 149 new MockLockOrientationCallback(&callback_results)); | 149 new MockLockOrientationCallback(&callback_results)); |
| 150 | 150 |
| 151 int request_id = GetFirstLockRequestIdFromSink(); | 151 int request_id = GetFirstLockRequestIdFromSink(); |
| 152 OnMessageReceived( | 152 OnMessageReceived( |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 EXPECT_FALSE(callback_results1.succeeded_); | 233 EXPECT_FALSE(callback_results1.succeeded_); |
| 234 EXPECT_TRUE(callback_results1.failed_); | 234 EXPECT_TRUE(callback_results1.failed_); |
| 235 EXPECT_EQ(blink::WebLockOrientationErrorCanceled, callback_results1.error_); | 235 EXPECT_EQ(blink::WebLockOrientationErrorCanceled, callback_results1.error_); |
| 236 | 236 |
| 237 // Second request is still pending. | 237 // Second request is still pending. |
| 238 EXPECT_FALSE(callback_results2.succeeded_); | 238 EXPECT_FALSE(callback_results2.succeeded_); |
| 239 EXPECT_FALSE(callback_results2.failed_); | 239 EXPECT_FALSE(callback_results2.failed_); |
| 240 } | 240 } |
| 241 | 241 |
| 242 } // namespace content | 242 } // namespace content |
| OLD | NEW |