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

Side by Side Diff: chrome_frame/test/chrome_frame_automation_mock.h

Issue 112433004: Update uses of UTF conversions in chrome_frame/, chromeos/, components/ to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 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 | « chrome_frame/simple_resource_loader.cc ('k') | chrome_frame/test/chrome_frame_test_utils.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) 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 #ifndef CHROME_FRAME_TEST_CHROME_FRAME_AUTOMATION_MOCK_H_ 5 #ifndef CHROME_FRAME_TEST_CHROME_FRAME_AUTOMATION_MOCK_H_
6 #define CHROME_FRAME_TEST_CHROME_FRAME_AUTOMATION_MOCK_H_ 6 #define CHROME_FRAME_TEST_CHROME_FRAME_AUTOMATION_MOCK_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 18 matching lines...) Expand all
29 const std::wstring& profile_name, 29 const std::wstring& profile_name,
30 const std::wstring& language, 30 const std::wstring& language,
31 bool incognito, bool is_widget_mode) 31 bool incognito, bool is_widget_mode)
32 : caller_message_loop_(caller_message_loop), is_connected_(false), 32 : caller_message_loop_(caller_message_loop), is_connected_(false),
33 navigation_result_(false), 33 navigation_result_(false),
34 mock_server_(1337, L"127.0.0.1", 34 mock_server_(1337, L"127.0.0.1",
35 chrome_frame_test::GetTestDataFolder()) { 35 chrome_frame_test::GetTestDataFolder()) {
36 36
37 // Endeavour to only kill off Chrome Frame derived Chrome processes. 37 // Endeavour to only kill off Chrome Frame derived Chrome processes.
38 base::KillAllNamedProcessesWithArgument( 38 base::KillAllNamedProcessesWithArgument(
39 UTF8ToWide(chrome_frame_test::kChromeImageName), 39 base::UTF8ToWide(chrome_frame_test::kChromeImageName),
40 UTF8ToWide(switches::kChromeFrame)); 40 base::UTF8ToWide(switches::kChromeFrame));
41 41
42 mock_server_.ExpectAndServeAnyRequests(CFInvocation(CFInvocation::NONE)); 42 mock_server_.ExpectAndServeAnyRequests(CFInvocation(CFInvocation::NONE));
43 43
44 base::FilePath profile_path; 44 base::FilePath profile_path;
45 GetChromeFrameProfilePath(profile_name, &profile_path); 45 GetChromeFrameProfilePath(profile_name, &profile_path);
46 chrome_frame_test::OverrideDataDirectoryForThisTest(profile_path.value()); 46 chrome_frame_test::OverrideDataDirectoryForThisTest(profile_path.value());
47 47
48 automation_client_ = new ChromeFrameAutomationClient; 48 automation_client_ = new ChromeFrameAutomationClient;
49 GURL empty; 49 GURL empty;
50 scoped_refptr<ChromeFrameLaunchParams> clp( 50 scoped_refptr<ChromeFrameLaunchParams> clp(
(...skipping 25 matching lines...) Expand all
76 76
77 // Navigate the external to a 'file://' url for unit test files 77 // Navigate the external to a 'file://' url for unit test files
78 bool NavigateRelativeFile(const std::wstring& file) { 78 bool NavigateRelativeFile(const std::wstring& file) {
79 base::FilePath cf_source_path; 79 base::FilePath cf_source_path;
80 PathService::Get(base::DIR_SOURCE_ROOT, &cf_source_path); 80 PathService::Get(base::DIR_SOURCE_ROOT, &cf_source_path);
81 std::wstring file_url(L"file://"); 81 std::wstring file_url(L"file://");
82 file_url.append(cf_source_path.Append( 82 file_url.append(cf_source_path.Append(
83 FILE_PATH_LITERAL("chrome_frame")).Append( 83 FILE_PATH_LITERAL("chrome_frame")).Append(
84 FILE_PATH_LITERAL("test")).Append( 84 FILE_PATH_LITERAL("test")).Append(
85 FILE_PATH_LITERAL("data")).Append(file).value()); 85 FILE_PATH_LITERAL("data")).Append(file).value());
86 return Navigate(WideToUTF8(file_url)); 86 return Navigate(base::WideToUTF8(file_url));
87 } 87 }
88 88
89 bool NavigateRelative(const std::wstring& relative_url) { 89 bool NavigateRelative(const std::wstring& relative_url) {
90 return Navigate(WideToUTF8(mock_server_.Resolve(relative_url.c_str()))); 90 return Navigate(base::WideToUTF8(
91 mock_server_.Resolve(relative_url.c_str())));
91 } 92 }
92 93
93 virtual void OnAutomationServerReady() { 94 virtual void OnAutomationServerReady() {
94 if (automation_client_.get()) { 95 if (automation_client_.get()) {
95 Create(NULL, 0, NULL, WS_OVERLAPPEDWINDOW); 96 Create(NULL, 0, NULL, WS_OVERLAPPEDWINDOW);
96 DCHECK(IsWindow()); 97 DCHECK(IsWindow());
97 is_connected_ = true; 98 is_connected_ = true;
98 } else { 99 } else {
99 NOTREACHED(); 100 NOTREACHED();
100 } 101 }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 virtual void OnAutomationServerReady() { 153 virtual void OnAutomationServerReady() {
153 Base::OnAutomationServerReady(); 154 Base::OnAutomationServerReady();
154 QuitMessageLoop(); 155 QuitMessageLoop();
155 } 156 }
156 bool launch_result() const { 157 bool launch_result() const {
157 return is_connected(); 158 return is_connected();
158 } 159 }
159 }; 160 };
160 161
161 #endif // CHROME_FRAME_TEST_CHROME_FRAME_AUTOMATION_MOCK_H_ 162 #endif // CHROME_FRAME_TEST_CHROME_FRAME_AUTOMATION_MOCK_H_
OLDNEW
« no previous file with comments | « chrome_frame/simple_resource_loader.cc ('k') | chrome_frame/test/chrome_frame_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698