OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/file_util.h" | 5 #include "base/file_util.h" |
6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "content/public/browser/web_contents.h" | 8 #include "content/public/browser/web_contents.h" |
9 #include "content/public/common/content_paths.h" | 9 #include "content/public/common/content_paths.h" |
10 #include "content/public/test/browser_test_utils.h" | 10 #include "content/public/test/browser_test_utils.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 ASSERT_TRUE(PathExists(file)); | 27 ASSERT_TRUE(PathExists(file)); |
28 NavigateToURL(shell(), net::FilePathToFileURL(file)); | 28 NavigateToURL(shell(), net::FilePathToFileURL(file)); |
29 | 29 |
30 RenderViewHost* rvh = shell()->web_contents()->GetRenderViewHost(); | 30 RenderViewHost* rvh = shell()->web_contents()->GetRenderViewHost(); |
31 ASSERT_TRUE(rvh); | 31 ASSERT_TRUE(rvh); |
32 EXPECT_TRUE(ExecuteWebUIResourceTest(rvh, include_libraries_)); | 32 EXPECT_TRUE(ExecuteWebUIResourceTest(rvh, include_libraries_)); |
33 } | 33 } |
34 | 34 |
35 void RunMediaInternalsTest(const base::FilePath::CharType* file) { | 35 void RunMediaInternalsTest(const base::FilePath::CharType* file) { |
36 AddLibrary(IDR_WEBUI_JS_CR); | 36 AddLibrary(IDR_WEBUI_JS_CR); |
37 AddLibrary(IDR_MEDIA_INTERNALS_NEW_JS); | 37 AddLibrary(IDR_MEDIA_INTERNALS_JS); |
38 | 38 |
39 base::FilePath path; | 39 base::FilePath path; |
40 PathService::Get(DIR_TEST_DATA, &path); | 40 PathService::Get(DIR_TEST_DATA, &path); |
41 RunTest(path.Append(FILE_PATH_LITERAL("media")) | 41 RunTest(path.Append(FILE_PATH_LITERAL("media")) |
42 .Append(FILE_PATH_LITERAL("webui")) | 42 .Append(FILE_PATH_LITERAL("webui")) |
43 .Append(file)); | 43 .Append(file)); |
44 } | 44 } |
45 | 45 |
46 // Queues the library corresponding to |resource_id| for injection into the | 46 // Queues the library corresponding to |resource_id| for injection into the |
47 // test. The code injection is performed post-load, so any common test | 47 // test. The code injection is performed post-load, so any common test |
(...skipping 16 matching lines...) Expand all Loading... |
64 | 64 |
65 IN_PROC_BROWSER_TEST_F(WebUIResourceBrowserTest, MediaInternals_PlayerInfo) { | 65 IN_PROC_BROWSER_TEST_F(WebUIResourceBrowserTest, MediaInternals_PlayerInfo) { |
66 RunMediaInternalsTest(FILE_PATH_LITERAL("player_info_test.html")); | 66 RunMediaInternalsTest(FILE_PATH_LITERAL("player_info_test.html")); |
67 } | 67 } |
68 | 68 |
69 IN_PROC_BROWSER_TEST_F(WebUIResourceBrowserTest, MediaInternals_Manager) { | 69 IN_PROC_BROWSER_TEST_F(WebUIResourceBrowserTest, MediaInternals_Manager) { |
70 RunMediaInternalsTest(FILE_PATH_LITERAL("manager_test.html")); | 70 RunMediaInternalsTest(FILE_PATH_LITERAL("manager_test.html")); |
71 } | 71 } |
72 | 72 |
73 } // namespace content | 73 } // namespace content |
OLD | NEW |