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/test/content_browser_test_utils.h" | 5 #include "content/test/content_browser_test_utils.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
11 #include "content/public/browser/navigation_controller.h" | 11 #include "content/public/browser/navigation_controller.h" |
12 #include "content/public/browser/notification_source.h" | 12 #include "content/public/browser/notification_source.h" |
13 #include "content/public/browser/web_contents.h" | 13 #include "content/public/browser/web_contents.h" |
14 #include "content/public/common/content_paths.h" | 14 #include "content/public/common/content_paths.h" |
15 #include "content/public/test/browser_test_utils.h" | 15 #include "content/public/test/browser_test_utils.h" |
16 #include "content/public/test/test_navigation_observer.h" | 16 #include "content/public/test/test_navigation_observer.h" |
17 #include "content/public/test/test_utils.h" | 17 #include "content/public/test/test_utils.h" |
18 #include "content/shell/shell.h" | 18 #include "content/shell/shell.h" |
19 #include "content/shell/shell_javascript_dialog_manager.h" | 19 #include "content/shell/shell_javascript_dialog_manager.h" |
20 #include "net/base/net_util.h" | 20 #include "net/base/net_util.h" |
21 | 21 |
22 namespace content { | 22 namespace content { |
23 | 23 |
24 FilePath GetTestFilePath(const char* dir, const char* file) { | 24 base::FilePath GetTestFilePath(const char* dir, const char* file) { |
25 FilePath path; | 25 base::FilePath path; |
26 PathService::Get(DIR_TEST_DATA, &path); | 26 PathService::Get(DIR_TEST_DATA, &path); |
27 return path.Append( | 27 return path.Append(base::FilePath().AppendASCII(dir).Append( |
28 FilePath().AppendASCII(dir).Append(FilePath().AppendASCII(file))); | 28 base::FilePath().AppendASCII(file))); |
29 } | 29 } |
30 | 30 |
31 GURL GetTestUrl(const char* dir, const char* file) { | 31 GURL GetTestUrl(const char* dir, const char* file) { |
32 return net::FilePathToFileURL(GetTestFilePath(dir, file)); | 32 return net::FilePathToFileURL(GetTestFilePath(dir, file)); |
33 } | 33 } |
34 | 34 |
35 void NavigateToURLBlockUntilNavigationsComplete(Shell* window, | 35 void NavigateToURLBlockUntilNavigationsComplete(Shell* window, |
36 const GURL& url, | 36 const GURL& url, |
37 int number_of_navigations) { | 37 int number_of_navigations) { |
38 WaitForLoadStop(window->web_contents()); | 38 WaitForLoadStop(window->web_contents()); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 } | 83 } |
84 | 84 |
85 void ShellAddedObserver::ShellCreated(Shell* shell) { | 85 void ShellAddedObserver::ShellCreated(Shell* shell) { |
86 DCHECK(!shell_); | 86 DCHECK(!shell_); |
87 shell_ = shell; | 87 shell_ = shell; |
88 if (runner_) | 88 if (runner_) |
89 runner_->QuitClosure().Run(); | 89 runner_->QuitClosure().Run(); |
90 } | 90 } |
91 | 91 |
92 } // namespace content | 92 } // namespace content |
OLD | NEW |