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 #include "chrome/browser/ui/webui/web_ui_browsertest.h" | 4 #include "chrome/browser/ui/webui/web_ui_browsertest.h" |
5 | 5 |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 | 315 |
316 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_data_directory_)); | 316 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_data_directory_)); |
317 test_data_directory_ = test_data_directory_.Append(kWebUITestFolder); | 317 test_data_directory_ = test_data_directory_.Append(kWebUITestFolder); |
318 ASSERT_TRUE(PathService::Get(chrome::DIR_GEN_TEST_DATA, | 318 ASSERT_TRUE(PathService::Get(chrome::DIR_GEN_TEST_DATA, |
319 &gen_test_data_directory_)); | 319 &gen_test_data_directory_)); |
320 | 320 |
321 // TODO(dtseng): should this be part of every BrowserTest or just WebUI test. | 321 // TODO(dtseng): should this be part of every BrowserTest or just WebUI test. |
322 FilePath resources_pack_path; | 322 FilePath resources_pack_path; |
323 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); | 323 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); |
324 ResourceBundle::GetSharedInstance().AddDataPack( | 324 ResourceBundle::GetSharedInstance().AddDataPack( |
325 resources_pack_path, ui::ResourceHandle::kScaleFactor100x); | 325 resources_pack_path, ui::SCALE_FACTOR_100P); |
326 | 326 |
327 FilePath mockPath; | 327 FilePath mockPath; |
328 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &mockPath)); | 328 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &mockPath)); |
329 mockPath = mockPath.AppendASCII("chrome"); | 329 mockPath = mockPath.AppendASCII("chrome"); |
330 mockPath = mockPath.AppendASCII("third_party"); | 330 mockPath = mockPath.AppendASCII("third_party"); |
331 mockPath = mockPath.AppendASCII("mock4js"); | 331 mockPath = mockPath.AppendASCII("mock4js"); |
332 mockPath = mockPath.Append(kMockJS); | 332 mockPath = mockPath.Append(kMockJS); |
333 AddLibrary(mockPath); | 333 AddLibrary(mockPath); |
334 AddLibrary(FilePath(kWebUILibraryJS)); | 334 AddLibrary(FilePath(kWebUILibraryJS)); |
335 } | 335 } |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 // testDone directly and expect pass result. | 689 // testDone directly and expect pass result. |
690 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPassesAsync) { | 690 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPassesAsync) { |
691 ASSERT_TRUE(RunJavascriptAsyncTest("testDone")); | 691 ASSERT_TRUE(RunJavascriptAsyncTest("testDone")); |
692 } | 692 } |
693 | 693 |
694 // Test that calling testDone during RunJavascriptTest still completes when | 694 // Test that calling testDone during RunJavascriptTest still completes when |
695 // waiting for async result. | 695 // waiting for async result. |
696 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPasses) { | 696 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPasses) { |
697 ASSERT_TRUE(RunJavascriptTest("testDone")); | 697 ASSERT_TRUE(RunJavascriptTest("testDone")); |
698 } | 698 } |
OLD | NEW |