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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/strings/stringprintf.h" | 6 #include "base/strings/stringprintf.h" |
7 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 7 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
8 #include "content/public/browser/navigation_entry.h" | 8 #include "content/public/browser/navigation_entry.h" |
9 #include "content/public/browser/resource_dispatcher_host_delegate.h" | 9 #include "content/public/browser/resource_dispatcher_host_delegate.h" |
10 #include "content/public/browser/resource_throttle.h" | 10 #include "content/public/browser/resource_throttle.h" |
11 #include "content/public/browser/web_contents.h" | 11 #include "content/public/browser/web_contents.h" |
12 #include "content/public/common/content_switches.h" | 12 #include "content/public/common/content_switches.h" |
13 #include "content/public/test/browser_test_utils.h" | 13 #include "content/public/test/browser_test_utils.h" |
| 14 #include "content/public/test/content_browser_test.h" |
| 15 #include "content/public/test/content_browser_test_utils.h" |
14 #include "content/public/test/test_navigation_observer.h" | 16 #include "content/public/test/test_navigation_observer.h" |
15 #include "content/shell/browser/shell.h" | 17 #include "content/shell/browser/shell.h" |
16 #include "content/shell/browser/shell_content_browser_client.h" | 18 #include "content/shell/browser/shell_content_browser_client.h" |
17 #include "content/shell/browser/shell_resource_dispatcher_host_delegate.h" | 19 #include "content/shell/browser/shell_resource_dispatcher_host_delegate.h" |
18 #include "content/test/content_browser_test.h" | |
19 #include "content/test/content_browser_test_utils.h" | |
20 #include "net/base/escape.h" | 20 #include "net/base/escape.h" |
21 #include "net/dns/mock_host_resolver.h" | 21 #include "net/dns/mock_host_resolver.h" |
22 #include "net/url_request/url_request.h" | 22 #include "net/url_request/url_request.h" |
23 #include "net/url_request/url_request_status.h" | 23 #include "net/url_request/url_request_status.h" |
24 #include "url/gurl.h" | 24 #include "url/gurl.h" |
25 | 25 |
26 namespace content { | 26 namespace content { |
27 | 27 |
28 // Tracks a single request for a specified URL, and allows waiting until the | 28 // Tracks a single request for a specified URL, and allows waiting until the |
29 // request is destroyed, and then inspecting whether it completed successfully. | 29 // request is destroyed, and then inspecting whether it completed successfully. |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 EXPECT_EQ(0, controller.GetCurrentEntryIndex()); | 457 EXPECT_EQ(0, controller.GetCurrentEntryIndex()); |
458 EXPECT_EQ(url1, controller.GetEntryAtIndex(0)->GetURL()); | 458 EXPECT_EQ(url1, controller.GetEntryAtIndex(0)->GetURL()); |
459 | 459 |
460 // Make sure the request for url2 did not complete. | 460 // Make sure the request for url2 did not complete. |
461 EXPECT_FALSE(tracking_delegate().WaitForTrackedURLAndGetCompleted()); | 461 EXPECT_FALSE(tracking_delegate().WaitForTrackedURLAndGetCompleted()); |
462 | 462 |
463 shell()->web_contents()->SetDelegate(old_delegate); | 463 shell()->web_contents()->SetDelegate(old_delegate); |
464 } | 464 } |
465 | 465 |
466 } // namespace content | 466 } // namespace content |
OLD | NEW |