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

Unified Diff: mojo/public/cpp/bindings/tests/request_response_unittest.cc

Issue 2136733002: Mojo C++ bindings: add a new mode to generator to use native STL/WTF types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@67_new
Patch Set: . Created 4 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 side-by-side diff with in-line comments
Download patch
Index: mojo/public/cpp/bindings/tests/request_response_unittest.cc
diff --git a/mojo/public/cpp/bindings/tests/request_response_unittest.cc b/mojo/public/cpp/bindings/tests/request_response_unittest.cc
index 3c024ade7fc6d9c0ba07df8963e76ca5a191952d..5e203a204da6e951df8b4f8b19a303b2c129480c 100644
--- a/mojo/public/cpp/bindings/tests/request_response_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/request_response_unittest.cc
@@ -22,7 +22,7 @@ class ProviderImpl : public sample::Provider {
explicit ProviderImpl(InterfaceRequest<sample::Provider> request)
: binding_(this, std::move(request)) {}
- void EchoString(const String& a,
+ void EchoString(const std::string& a,
const EchoStringCallback& callback) override {
EchoStringCallback callback_copy;
// Make sure operator= is used.
@@ -30,8 +30,8 @@ class ProviderImpl : public sample::Provider {
callback_copy.Run(a);
}
- void EchoStrings(const String& a,
- const String& b,
+ void EchoStrings(const std::string& a,
+ const std::string& b,
const EchoStringsCallback& callback) override {
callback.Run(a, b);
}
@@ -55,16 +55,16 @@ class ProviderImpl : public sample::Provider {
void RecordString(std::string* storage,
const base::Closure& closure,
- String str) {
+ const std::string& str) {
*storage = str;
closure.Run();
}
void RecordStrings(std::string* storage,
const base::Closure& closure,
- String a,
- String b) {
- *storage = a.get() + b.get();
+ const std::string& a,
+ const std::string& b) {
+ *storage = a + b;
closure.Run();
}
@@ -99,7 +99,7 @@ TEST_F(RequestResponseTest, EchoString) {
std::string buf;
base::RunLoop run_loop;
- provider->EchoString(String::From("hello"),
+ provider->EchoString("hello",
base::Bind(&RecordString, &buf, run_loop.QuitClosure()));
run_loop.Run();
@@ -113,9 +113,8 @@ TEST_F(RequestResponseTest, EchoStrings) {
std::string buf;
base::RunLoop run_loop;
- provider->EchoStrings(
- String::From("hello"), String::From(" world"),
- base::Bind(&RecordStrings, &buf, run_loop.QuitClosure()));
+ provider->EchoStrings("hello", " world", base::Bind(&RecordStrings, &buf,
+ run_loop.QuitClosure()));
run_loop.Run();
« no previous file with comments | « mojo/public/cpp/bindings/tests/pickle_unittest.cc ('k') | mojo/public/cpp/bindings/tests/sample_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698