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

Side by Side Diff: services/js/echo_apptest.cc

Issue 780213002: Put code in //services/js in namespace js (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "services/js/test/echo_service.mojom.h" 5 #include "services/js/test/echo_service.mojom.h"
6 #include "services/js/test/js_application_test_base.h" 6 #include "services/js/test/js_application_test_base.h"
7 7
8 namespace mojo { 8 using mojo::String;
9
10 namespace js {
9 namespace { 11 namespace {
10 12
11 class JSEchoTest : public test::JSApplicationTestBase { 13 class JSEchoTest : public test::JSApplicationTestBase {
12 public: 14 public:
13 JSEchoTest() : JSApplicationTestBase() {} 15 JSEchoTest() : JSApplicationTestBase() {}
14 ~JSEchoTest() override {} 16 ~JSEchoTest() override {}
15 17
16 protected: 18 protected:
17 // ApplicationTestBase: 19 // ApplicationTestBase:
18 void SetUp() override { 20 void SetUp() override {
19 ApplicationTestBase::SetUp(); 21 ApplicationTestBase::SetUp();
20 const std::string& url = JSAppURL("echo.js"); 22 const std::string& url = JSAppURL("echo.js");
21 application_impl()->ConnectToService(url, &echo_service_); 23 application_impl()->ConnectToService(url, &echo_service_);
22 } 24 }
23 25
24 EchoServicePtr echo_service_; 26 mojo::EchoServicePtr echo_service_;
25 27
26 private: 28 private:
27 MOJO_DISALLOW_COPY_AND_ASSIGN(JSEchoTest); 29 MOJO_DISALLOW_COPY_AND_ASSIGN(JSEchoTest);
28 }; 30 };
29 31
30 struct EchoStringCallback { 32 struct EchoStringCallback {
31 explicit EchoStringCallback(String *s) : echo_value(s) {} 33 explicit EchoStringCallback(String *s) : echo_value(s) {}
32 void Run(const String& value) const { 34 void Run(const String& value) const {
33 *echo_value = value; 35 *echo_value = value;
34 } 36 }
(...skipping 21 matching lines...) Expand all
56 TEST_F(JSEchoTest, EchoNullString) { 58 TEST_F(JSEchoTest, EchoNullString) {
57 String null; 59 String null;
58 EchoStringCallback callback(&null); 60 EchoStringCallback callback(&null);
59 echo_service_->EchoString(nullptr, callback); 61 echo_service_->EchoString(nullptr, callback);
60 EXPECT_TRUE(echo_service_.WaitForIncomingMethodCall()); 62 EXPECT_TRUE(echo_service_.WaitForIncomingMethodCall());
61 EXPECT_TRUE(null.is_null()); 63 EXPECT_TRUE(null.is_null());
62 echo_service_->EchoString("quit", callback); 64 echo_service_->EchoString("quit", callback);
63 } 65 }
64 66
65 } // namespace 67 } // namespace
66 } // namespace mojo 68 } // namespace js
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698