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

Side by Side Diff: content/renderer/cpp_bound_class_unittest.cc

Issue 102593002: Convert string16 to base::string16 in content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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) 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 // Tests for CppBoundClass, in conjunction with CppBindingExample. Binds 5 // Tests for CppBoundClass, in conjunction with CppBindingExample. Binds
6 // a CppBindingExample class into JavaScript in a custom test shell and tests 6 // a CppBindingExample class into JavaScript in a custom test shell and tests
7 // the binding from the outside by loading JS into the shell. 7 // the binding from the outside by loading JS into the shell.
8 8
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "content/public/common/url_constants.h" 10 #include "content/public/common/url_constants.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 // text is empty. 97 // text is empty.
98 void CheckJavaScriptFailure(const std::string& javascript) { 98 void CheckJavaScriptFailure(const std::string& javascript) {
99 ExecuteJavaScript(javascript.c_str()); 99 ExecuteJavaScript(javascript.c_str());
100 EXPECT_EQ( 100 EXPECT_EQ(
101 "", 101 "",
102 UTF16ToASCII(GetMainFrame()->document().documentElement().innerText())); 102 UTF16ToASCII(GetMainFrame()->document().documentElement().innerText()));
103 } 103 }
104 104
105 void CheckTrue(const std::string& expression) { 105 void CheckTrue(const std::string& expression) {
106 int was_page_a = -1; 106 int was_page_a = -1;
107 string16 check_page_a = 107 base::string16 check_page_a =
108 ASCIIToUTF16(std::string("Number(") + expression + ")"); 108 ASCIIToUTF16(std::string("Number(") + expression + ")");
109 EXPECT_TRUE(ExecuteJavaScriptAndReturnIntValue(check_page_a, &was_page_a)); 109 EXPECT_TRUE(ExecuteJavaScriptAndReturnIntValue(check_page_a, &was_page_a));
110 EXPECT_EQ(1, was_page_a); 110 EXPECT_EQ(1, was_page_a);
111 } 111 }
112 112
113 protected: 113 protected:
114 virtual bool useFallback() { 114 virtual bool useFallback() {
115 return false; 115 return false;
116 } 116 }
117 117
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 } 232 }
233 233
234 // Ensures existent methods can be invoked successfully when the fallback method 234 // Ensures existent methods can be invoked successfully when the fallback method
235 // is used 235 // is used
236 TEST_F(CppBoundClassWithFallbackMethodTest, 236 TEST_F(CppBoundClassWithFallbackMethodTest,
237 InvokeExistentMethodsWithFallback) { 237 InvokeExistentMethodsWithFallback) {
238 CheckTrue("example.echoValue(34) == 34"); 238 CheckTrue("example.echoValue(34) == 34");
239 } 239 }
240 240
241 } // namespace content 241 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/android/phone_number_detector_unittest.cc ('k') | content/renderer/dom_storage/dom_storage_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698