OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/test/base/web_ui_browser_test.h" | 5 #include "chrome/test/base/web_ui_browser_test.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/lazy_instance.h" | 12 #include "base/lazy_instance.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/ref_counted_memory.h" | 14 #include "base/memory/ref_counted_memory.h" |
15 #include "base/path_service.h" | 15 #include "base/path_service.h" |
16 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
17 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
| 18 #include "base/threading/thread_restrictions.h" |
18 #include "base/values.h" | 19 #include "base/values.h" |
19 #include "chrome/browser/chrome_content_browser_client.h" | 20 #include "chrome/browser/chrome_content_browser_client.h" |
20 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
21 #include "chrome/browser/ui/browser.h" | 22 #include "chrome/browser/ui/browser.h" |
22 #include "chrome/browser/ui/browser_commands.h" | 23 #include "chrome/browser/ui/browser_commands.h" |
23 #include "chrome/browser/ui/browser_navigator_params.h" | 24 #include "chrome/browser/ui/browser_navigator_params.h" |
24 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 25 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
25 #include "chrome/browser/ui/webui/web_ui_test_handler.h" | 26 #include "chrome/browser/ui/webui/web_ui_test_handler.h" |
26 #include "chrome/common/chrome_paths.h" | 27 #include "chrome/common/chrome_paths.h" |
27 #include "chrome/common/url_constants.h" | 28 #include "chrome/common/url_constants.h" |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 test_handler_->RegisterMessages(); | 487 test_handler_->RegisterMessages(); |
487 | 488 |
488 if (GetMockMessageHandler()) { | 489 if (GetMockMessageHandler()) { |
489 GetMockMessageHandler()->set_web_ui(web_ui_instance); | 490 GetMockMessageHandler()->set_web_ui(web_ui_instance); |
490 GetMockMessageHandler()->RegisterMessages(); | 491 GetMockMessageHandler()->RegisterMessages(); |
491 } | 492 } |
492 } | 493 } |
493 | 494 |
494 GURL WebUIBrowserTest::WebUITestDataPathToURL( | 495 GURL WebUIBrowserTest::WebUITestDataPathToURL( |
495 const base::FilePath::StringType& path) { | 496 const base::FilePath::StringType& path) { |
| 497 base::ThreadRestrictions::ScopedAllowIO allow_io; |
496 base::FilePath dir_test_data; | 498 base::FilePath dir_test_data; |
497 EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &dir_test_data)); | 499 EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &dir_test_data)); |
498 base::FilePath test_path(dir_test_data.Append(kWebUITestFolder).Append(path)); | 500 base::FilePath test_path(dir_test_data.Append(kWebUITestFolder).Append(path)); |
499 EXPECT_TRUE(base::PathExists(test_path)); | 501 EXPECT_TRUE(base::PathExists(test_path)); |
500 return net::FilePathToFileURL(test_path); | 502 return net::FilePathToFileURL(test_path); |
501 } | 503 } |
OLD | NEW |