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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
| 7 #include <memory> |
| 8 |
7 #include "base/bind.h" | 9 #include "base/bind.h" |
8 #include "base/cancelable_callback.h" | 10 #include "base/cancelable_callback.h" |
9 #include "base/command_line.h" | 11 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
11 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
12 #include "base/location.h" | 14 #include "base/location.h" |
13 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/ptr_util.h" |
14 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
15 #include "base/path_service.h" | 18 #include "base/path_service.h" |
16 #include "base/single_thread_task_runner.h" | 19 #include "base/single_thread_task_runner.h" |
17 #include "base/strings/string_number_conversions.h" | 20 #include "base/strings/string_number_conversions.h" |
18 #include "base/strings/string_util.h" | 21 #include "base/strings/string_util.h" |
19 #include "base/strings/stringprintf.h" | 22 #include "base/strings/stringprintf.h" |
20 #include "base/strings/utf_string_conversions.h" | 23 #include "base/strings/utf_string_conversions.h" |
21 #include "base/test/test_timeouts.h" | 24 #include "base/test/test_timeouts.h" |
22 #include "base/thread_task_runner_handle.h" | 25 #include "base/thread_task_runner_handle.h" |
23 #include "build/build_config.h" | 26 #include "build/build_config.h" |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 }; | 217 }; |
215 | 218 |
216 class TestInterceptor : public net::URLRequestInterceptor { | 219 class TestInterceptor : public net::URLRequestInterceptor { |
217 public: | 220 public: |
218 // Creates TestInterceptor and registers it with the URLRequestFilter, | 221 // Creates TestInterceptor and registers it with the URLRequestFilter, |
219 // which takes ownership of it. | 222 // which takes ownership of it. |
220 static void Register(const GURL& url, const base::FilePath& file_path) { | 223 static void Register(const GURL& url, const base::FilePath& file_path) { |
221 EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 224 EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
222 net::URLRequestFilter::GetInstance()->AddHostnameInterceptor( | 225 net::URLRequestFilter::GetInstance()->AddHostnameInterceptor( |
223 url.scheme(), url.host(), | 226 url.scheme(), url.host(), |
224 make_scoped_ptr(new TestInterceptor(url, file_path))); | 227 base::WrapUnique(new TestInterceptor(url, file_path))); |
225 } | 228 } |
226 | 229 |
227 // Unregisters previously created TestInterceptor, which should delete it. | 230 // Unregisters previously created TestInterceptor, which should delete it. |
228 static void Unregister(const GURL& url) { | 231 static void Unregister(const GURL& url) { |
229 EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 232 EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
230 net::URLRequestFilter::GetInstance()->RemoveHostnameHandler(url.scheme(), | 233 net::URLRequestFilter::GetInstance()->RemoveHostnameHandler(url.scheme(), |
231 url.host()); | 234 url.host()); |
232 } | 235 } |
233 | 236 |
234 // net::URLRequestJobFactory::ProtocolHandler implementation: | 237 // net::URLRequestJobFactory::ProtocolHandler implementation: |
(...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1346 | 1349 |
1347 SimulateTapAt(web_contents, gfx::Point(30, 60)); | 1350 SimulateTapAt(web_contents, gfx::Point(30, 60)); |
1348 DispatchInPageAndWait("waitForEvent", "gesturetap"); | 1351 DispatchInPageAndWait("waitForEvent", "gesturetap"); |
1349 | 1352 |
1350 DispatchAndWait("stopTimeline"); | 1353 DispatchAndWait("stopTimeline"); |
1351 RunTestMethod("checkInputEventsPresent", "MouseMove", "MouseDown", | 1354 RunTestMethod("checkInputEventsPresent", "MouseMove", "MouseDown", |
1352 "MouseWheel", "GestureTap"); | 1355 "MouseWheel", "GestureTap"); |
1353 | 1356 |
1354 CloseDevToolsWindow(); | 1357 CloseDevToolsWindow(); |
1355 } | 1358 } |
OLD | NEW |