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" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 protected: | 67 protected: |
68 void SetUp() override { | 68 void SetUp() override { |
69 dispatcher_.reset(new ScreenOrientationDispatcherWithSink(&sink_)); | 69 dispatcher_.reset(new ScreenOrientationDispatcherWithSink(&sink_)); |
70 } | 70 } |
71 | 71 |
72 int GetFirstLockRequestIdFromSink() { | 72 int GetFirstLockRequestIdFromSink() { |
73 const IPC::Message* msg = sink().GetFirstMessageMatching( | 73 const IPC::Message* msg = sink().GetFirstMessageMatching( |
74 ScreenOrientationHostMsg_LockRequest::ID); | 74 ScreenOrientationHostMsg_LockRequest::ID); |
75 EXPECT_TRUE(msg != NULL); | 75 EXPECT_TRUE(msg != NULL); |
76 | 76 |
77 Tuple<blink::WebScreenOrientationLockType,int> params; | 77 base::Tuple<blink::WebScreenOrientationLockType, int> params; |
78 ScreenOrientationHostMsg_LockRequest::Read(msg, ¶ms); | 78 ScreenOrientationHostMsg_LockRequest::Read(msg, ¶ms); |
79 return get<1>(params); | 79 return base::get<1>(params); |
80 } | 80 } |
81 | 81 |
82 IPC::TestSink& sink() { | 82 IPC::TestSink& sink() { |
83 return sink_; | 83 return sink_; |
84 } | 84 } |
85 | 85 |
86 void LockOrientation(blink::WebScreenOrientationLockType orientation, | 86 void LockOrientation(blink::WebScreenOrientationLockType orientation, |
87 blink::WebLockOrientationCallback* callback) { | 87 blink::WebLockOrientationCallback* callback) { |
88 dispatcher_->lockOrientation(orientation, callback); | 88 dispatcher_->lockOrientation(orientation, callback); |
89 } | 89 } |
(...skipping 144 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 |