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

Side by Side Diff: content/public/test/browser_test_utils.cc

Issue 2023243002: Remove base::Tuple (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: lint fix Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/public/test/browser_test_utils.h" 5 #include "content/public/test/browser_test_utils.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <tuple>
8 #include <utility> 9 #include <utility>
9 10
10 #include "base/auto_reset.h" 11 #include "base/auto_reset.h"
11 #include "base/bind.h" 12 #include "base/bind.h"
12 #include "base/command_line.h" 13 #include "base/command_line.h"
13 #include "base/json/json_reader.h" 14 #include "base/json/json_reader.h"
14 #include "base/macros.h" 15 #include "base/macros.h"
15 #include "base/process/kill.h" 16 #include "base/process/kill.h"
16 #include "base/rand_util.h" 17 #include "base/rand_util.h"
17 #include "base/strings/string_number_conversions.h" 18 #include "base/strings/string_number_conversions.h"
(...skipping 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after
1144 if (frames_to_wait_ == 0) 1145 if (frames_to_wait_ == 0)
1145 quit_.Run(); 1146 quit_.Run();
1146 } 1147 }
1147 1148
1148 bool FrameWatcher::OnMessageReceived(const IPC::Message& message) { 1149 bool FrameWatcher::OnMessageReceived(const IPC::Message& message) {
1149 if (message.type() == ViewHostMsg_SwapCompositorFrame::ID) { 1150 if (message.type() == ViewHostMsg_SwapCompositorFrame::ID) {
1150 ViewHostMsg_SwapCompositorFrame::Param param; 1151 ViewHostMsg_SwapCompositorFrame::Param param;
1151 if (!ViewHostMsg_SwapCompositorFrame::Read(&message, &param)) 1152 if (!ViewHostMsg_SwapCompositorFrame::Read(&message, &param))
1152 return false; 1153 return false;
1153 std::unique_ptr<cc::CompositorFrame> frame(new cc::CompositorFrame); 1154 std::unique_ptr<cc::CompositorFrame> frame(new cc::CompositorFrame);
1154 base::get<1>(param).AssignTo(frame.get()); 1155 std::get<1>(param).AssignTo(frame.get());
1155 1156
1156 BrowserThread::PostTask( 1157 BrowserThread::PostTask(
1157 BrowserThread::UI, FROM_HERE, 1158 BrowserThread::UI, FROM_HERE,
1158 base::Bind(&FrameWatcher::ReceivedFrameSwap, this, frame->metadata)); 1159 base::Bind(&FrameWatcher::ReceivedFrameSwap, this, frame->metadata));
1159 } 1160 }
1160 return false; 1161 return false;
1161 } 1162 }
1162 1163
1163 void FrameWatcher::AttachTo(WebContents* web_contents) { 1164 void FrameWatcher::AttachTo(WebContents* web_contents) {
1164 DCHECK(web_contents); 1165 DCHECK(web_contents);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
1235 if (!quit_.is_null()) 1236 if (!quit_.is_null())
1236 quit_.Run(); 1237 quit_.Run();
1237 } 1238 }
1238 } 1239 }
1239 1240
1240 bool InputMsgWatcher::OnMessageReceived(const IPC::Message& message) { 1241 bool InputMsgWatcher::OnMessageReceived(const IPC::Message& message) {
1241 DCHECK_CURRENTLY_ON(BrowserThread::IO); 1242 DCHECK_CURRENTLY_ON(BrowserThread::IO);
1242 if (message.type() == InputHostMsg_HandleInputEvent_ACK::ID) { 1243 if (message.type() == InputHostMsg_HandleInputEvent_ACK::ID) {
1243 InputHostMsg_HandleInputEvent_ACK::Param params; 1244 InputHostMsg_HandleInputEvent_ACK::Param params;
1244 InputHostMsg_HandleInputEvent_ACK::Read(&message, &params); 1245 InputHostMsg_HandleInputEvent_ACK::Read(&message, &params);
1245 blink::WebInputEvent::Type ack_type = base::get<0>(params).type; 1246 blink::WebInputEvent::Type ack_type = std::get<0>(params).type;
1246 InputEventAckState ack_state = base::get<0>(params).state; 1247 InputEventAckState ack_state = std::get<0>(params).state;
1247 BrowserThread::PostTask( 1248 BrowserThread::PostTask(
1248 BrowserThread::UI, FROM_HERE, 1249 BrowserThread::UI, FROM_HERE,
1249 base::Bind(&InputMsgWatcher::ReceivedAck, this, ack_type, ack_state)); 1250 base::Bind(&InputMsgWatcher::ReceivedAck, this, ack_type, ack_state));
1250 } 1251 }
1251 return false; 1252 return false;
1252 } 1253 }
1253 1254
1254 uint32_t InputMsgWatcher::WaitForAck() { 1255 uint32_t InputMsgWatcher::WaitForAck() {
1255 DCHECK_CURRENTLY_ON(BrowserThread::UI); 1256 DCHECK_CURRENTLY_ON(BrowserThread::UI);
1256 if (ack_result_ != INPUT_EVENT_ACK_STATE_UNKNOWN) 1257 if (ack_result_ != INPUT_EVENT_ACK_STATE_UNKNOWN)
1257 return ack_result_; 1258 return ack_result_;
1258 base::RunLoop run_loop; 1259 base::RunLoop run_loop;
1259 base::AutoReset<base::Closure> reset_quit(&quit_, run_loop.QuitClosure()); 1260 base::AutoReset<base::Closure> reset_quit(&quit_, run_loop.QuitClosure());
1260 run_loop.Run(); 1261 run_loop.Run();
1261 return ack_result_; 1262 return ack_result_;
1262 } 1263 }
1263 1264
1264 } // namespace content 1265 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698