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

Side by Side Diff: chrome/browser/automation/automation_tab_helper_browsertest.cc

Issue 8687002: Cleanup: Convert ASCIIToUTF16("") to string16(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <string> 5 #include <string>
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/string16.h"
9 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
10 #include "base/utf_string_conversions.h" 11 #include "base/utf_string_conversions.h"
11 #include "chrome/browser/automation/automation_tab_helper.h" 12 #include "chrome/browser/automation/automation_tab_helper.h"
12 #include "chrome/browser/automation/mock_tab_event_observer.h" 13 #include "chrome/browser/automation/mock_tab_event_observer.h"
13 #include "chrome/browser/ui/browser.h" 14 #include "chrome/browser/ui/browser.h"
14 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 15 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
15 #include "chrome/common/chrome_notification_types.h" 16 #include "chrome/common/chrome_notification_types.h"
16 #include "chrome/common/chrome_paths.h" 17 #include "chrome/common/chrome_paths.h"
17 #include "chrome/common/url_constants.h" 18 #include "chrome/common/url_constants.h"
18 #include "chrome/test/base/in_process_browser_test.h" 19 #include "chrome/test/base/in_process_browser_test.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 std::string script = base::StringPrintf("runTestCase(%d);", 91 std::string script = base::StringPrintf("runTestCase(%d);",
91 test_case_number); 92 test_case_number);
92 RenderViewHost* host = 93 RenderViewHost* host =
93 browser()->GetSelectedTabContents()->render_view_host(); 94 browser()->GetSelectedTabContents()->render_view_host();
94 if (wait_for_response) { 95 if (wait_for_response) {
95 ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( 96 ASSERT_TRUE(ui_test_utils::ExecuteJavaScript(
96 host, L"", ASCIIToWide(script))); 97 host, L"", ASCIIToWide(script)));
97 } else { 98 } else {
98 script += "window.domAutomationController.setAutomationId(0);" 99 script += "window.domAutomationController.setAutomationId(0);"
99 "window.domAutomationController.send(0);"; 100 "window.domAutomationController.send(0);";
100 host->ExecuteJavascriptInWebFrame(ASCIIToUTF16(""), ASCIIToUTF16(script)); 101 host->ExecuteJavascriptInWebFrame(string16(), ASCIIToUTF16(script));
101 } 102 }
102 } 103 }
103 104
104 // Returns the |AutomationTabHelper| for the first browser's first tab. 105 // Returns the |AutomationTabHelper| for the first browser's first tab.
105 AutomationTabHelper* tab_helper() { 106 AutomationTabHelper* tab_helper() {
106 return browser()->GetTabContentsWrapperAt(0)->automation_tab_helper(); 107 return browser()->GetTabContentsWrapperAt(0)->automation_tab_helper();
107 } 108 }
108 109
109 protected: 110 protected:
110 FilePath test_data_dir_; 111 FilePath test_data_dir_;
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 IN_PROC_BROWSER_TEST_F(AutomationTabHelperBrowserTest, 207 IN_PROC_BROWSER_TEST_F(AutomationTabHelperBrowserTest,
207 CrashedTabStopsLoading) { 208 CrashedTabStopsLoading) {
208 MockTabEventObserver mock_tab_observer(tab_helper()); 209 MockTabEventObserver mock_tab_observer(tab_helper());
209 210
210 testing::InSequence expect_in_sequence; 211 testing::InSequence expect_in_sequence;
211 EXPECT_CALL(mock_tab_observer, OnFirstPendingLoad(_)); 212 EXPECT_CALL(mock_tab_observer, OnFirstPendingLoad(_));
212 EXPECT_CALL(mock_tab_observer, OnNoMorePendingLoads(_)); 213 EXPECT_CALL(mock_tab_observer, OnNoMorePendingLoads(_));
213 214
214 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUICrashURL)); 215 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUICrashURL));
215 } 216 }
OLDNEW
« no previous file with comments | « chrome/browser/autofill/phone_number_unittest.cc ('k') | chrome/browser/download/download_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698