Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: webkit/tools/test_shell/test_shell_test.cc

Issue 149620: Use WebWidget from the WebKit API. This change also makes... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/tools/test_shell/test_shell_main.cc ('k') | webkit/tools/test_shell/test_shell_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "webkit/tools/test_shell/test_shell_test.h" 5 #include "webkit/tools/test_shell/test_shell_test.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
11 #include "base/file_util.h" 11 #include "base/file_util.h"
12 #include "base/message_loop.h" 12 #include "base/message_loop.h"
13 #include "base/path_service.h" 13 #include "base/path_service.h"
14 #include "base/string_util.h" 14 #include "base/string_util.h"
15 15
16 std::wstring TestShellTest::GetTestURL(const FilePath& test_case_path, 16 std::wstring TestShellTest::GetTestURL(const FilePath& test_case_path,
17 const std::string& test_case) { 17 const std::string& test_case) {
18 return test_case_path.AppendASCII(test_case).ToWStringHack(); 18 return test_case_path.AppendASCII(test_case).ToWStringHack();
19 } 19 }
20 20
21 void TestShellTest::SetUp() { 21 void TestShellTest::SetUp() {
22 // Make a test shell for use by the test. 22 // Make a test shell for use by the test.
23 CreateEmptyWindow(); 23 CreateEmptyWindow();
24 test_shell_->Show(test_shell_->webView(), NEW_WINDOW); 24 test_shell_->Show(WebKit::WebNavigationPolicyNewWindow);
25 25
26 // Point data_dir_ to the root of the test case dir 26 // Point data_dir_ to the root of the test case dir
27 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &data_dir_)); 27 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &data_dir_));
28 data_dir_ = data_dir_.Append(FILE_PATH_LITERAL("webkit")); 28 data_dir_ = data_dir_.Append(FILE_PATH_LITERAL("webkit"));
29 data_dir_ = data_dir_.Append(FILE_PATH_LITERAL("data")); 29 data_dir_ = data_dir_.Append(FILE_PATH_LITERAL("data"));
30 ASSERT_TRUE(file_util::PathExists(data_dir_)); 30 ASSERT_TRUE(file_util::PathExists(data_dir_));
31 } 31 }
32 32
33 void TestShellTest::TearDown() { 33 void TestShellTest::TearDown() {
34 // Loading a blank url clears the memory in the current page. 34 // Loading a blank url clears the memory in the current page.
35 test_shell_->LoadURL(L"about:blank"); 35 test_shell_->LoadURL(L"about:blank");
36 test_shell_->DestroyWindow(test_shell_->mainWnd()); 36 test_shell_->DestroyWindow(test_shell_->mainWnd());
37 LayoutTestController::ClearShell(); 37 LayoutTestController::ClearShell();
38 38
39 // Flush the MessageLoop of any residual tasks. 39 // Flush the MessageLoop of any residual tasks.
40 MessageLoop::current()->RunAllPending(); 40 MessageLoop::current()->RunAllPending();
41 } 41 }
42 42
43 void TestShellTest::CreateEmptyWindow() { 43 void TestShellTest::CreateEmptyWindow() {
44 TestShell::CreateNewWindow(L"about:blank", &test_shell_); 44 TestShell::CreateNewWindow(L"about:blank", &test_shell_);
45 } 45 }
OLDNEW
« no previous file with comments | « webkit/tools/test_shell/test_shell_main.cc ('k') | webkit/tools/test_shell/test_shell_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698