| 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 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "content/common/screen_orientation_messages.h" | 11 #include "content/common/screen_orientation_messages.h" |
| 12 #include "content/public/test/test_utils.h" | 12 #include "content/public/test/test_utils.h" |
| 13 #include "ipc/ipc_test_sink.h" | 13 #include "ipc/ipc_test_sink.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 #include "third_party/WebKit/public/platform/WebLockOrientationCallback.h" | 15 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebLockO
rientationCallback.h" |
| 16 | 16 |
| 17 namespace content { | 17 namespace content { |
| 18 | 18 |
| 19 // MockLockOrientationCallback is an implementation of | 19 // MockLockOrientationCallback is an implementation of |
| 20 // WebLockOrientationCallback and takes a LockOrientationResultHolder* as a | 20 // WebLockOrientationCallback and takes a LockOrientationResultHolder* as a |
| 21 // parameter when being constructed. The |results_| pointer is owned by the | 21 // parameter when being constructed. The |results_| pointer is owned by the |
| 22 // caller and not by the callback object. The intent being that as soon as the | 22 // caller and not by the callback object. The intent being that as soon as the |
| 23 // callback is resolved, it will be killed so we use the | 23 // callback is resolved, it will be killed so we use the |
| 24 // LockOrientationResultHolder to know in which state the callback object is at | 24 // LockOrientationResultHolder to know in which state the callback object is at |
| 25 // any time. | 25 // any time. |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 EXPECT_FALSE(callback_results1.succeeded_); | 234 EXPECT_FALSE(callback_results1.succeeded_); |
| 235 EXPECT_TRUE(callback_results1.failed_); | 235 EXPECT_TRUE(callback_results1.failed_); |
| 236 EXPECT_EQ(blink::WebLockOrientationErrorCanceled, callback_results1.error_); | 236 EXPECT_EQ(blink::WebLockOrientationErrorCanceled, callback_results1.error_); |
| 237 | 237 |
| 238 // Second request is still pending. | 238 // Second request is still pending. |
| 239 EXPECT_FALSE(callback_results2.succeeded_); | 239 EXPECT_FALSE(callback_results2.succeeded_); |
| 240 EXPECT_FALSE(callback_results2.failed_); | 240 EXPECT_FALSE(callback_results2.failed_); |
| 241 } | 241 } |
| 242 | 242 |
| 243 } // namespace content | 243 } // namespace content |
| OLD | NEW |