OLD | NEW |
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 <utility> |
8 | 9 |
9 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
10 #include "base/bind.h" | 11 #include "base/bind.h" |
11 #include "base/command_line.h" | 12 #include "base/command_line.h" |
12 #include "base/json/json_reader.h" | 13 #include "base/json/json_reader.h" |
13 #include "base/macros.h" | 14 #include "base/macros.h" |
14 #include "base/process/kill.h" | 15 #include "base/process/kill.h" |
15 #include "base/rand_util.h" | 16 #include "base/rand_util.h" |
16 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" |
17 #include "base/strings/string_piece.h" | 18 #include "base/strings/string_piece.h" |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 | 303 |
303 // Append the real part of the path to the new URL. | 304 // Append the real part of the path to the new URL. |
304 std::string path = params.substr(slash + 1); | 305 std::string path = params.substr(slash + 1); |
305 GURL redirect_target(redirect_server.Resolve(path)); | 306 GURL redirect_target(redirect_server.Resolve(path)); |
306 DCHECK(redirect_target.is_valid()); | 307 DCHECK(redirect_target.is_valid()); |
307 | 308 |
308 scoped_ptr<net::test_server::BasicHttpResponse> http_response( | 309 scoped_ptr<net::test_server::BasicHttpResponse> http_response( |
309 new net::test_server::BasicHttpResponse); | 310 new net::test_server::BasicHttpResponse); |
310 http_response->set_code(net::HTTP_MOVED_PERMANENTLY); | 311 http_response->set_code(net::HTTP_MOVED_PERMANENTLY); |
311 http_response->AddCustomHeader("Location", redirect_target.spec()); | 312 http_response->AddCustomHeader("Location", redirect_target.spec()); |
312 return http_response.Pass(); | 313 return std::move(http_response); |
313 } | 314 } |
314 | 315 |
315 } // namespace | 316 } // namespace |
316 | 317 |
317 bool NavigateIframeToURL(WebContents* web_contents, | 318 bool NavigateIframeToURL(WebContents* web_contents, |
318 std::string iframe_id, | 319 std::string iframe_id, |
319 const GURL& url) { | 320 const GURL& url) { |
320 std::string script = base::StringPrintf( | 321 std::string script = base::StringPrintf( |
321 "setTimeout(\"" | 322 "setTimeout(\"" |
322 "var iframes = document.getElementById('%s');iframes.src='%s';" | 323 "var iframes = document.getElementById('%s');iframes.src='%s';" |
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1096 void FrameWatcher::WaitFrames(int frames_to_wait) { | 1097 void FrameWatcher::WaitFrames(int frames_to_wait) { |
1097 if (frames_to_wait <= 0) | 1098 if (frames_to_wait <= 0) |
1098 return; | 1099 return; |
1099 base::RunLoop run_loop; | 1100 base::RunLoop run_loop; |
1100 base::AutoReset<base::Closure> reset_quit(&quit_, run_loop.QuitClosure()); | 1101 base::AutoReset<base::Closure> reset_quit(&quit_, run_loop.QuitClosure()); |
1101 base::AutoReset<int> reset_frames_to_wait(&frames_to_wait_, frames_to_wait); | 1102 base::AutoReset<int> reset_frames_to_wait(&frames_to_wait_, frames_to_wait); |
1102 run_loop.Run(); | 1103 run_loop.Run(); |
1103 } | 1104 } |
1104 | 1105 |
1105 } // namespace content | 1106 } // namespace content |
OLD | NEW |