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

Side by Side Diff: components/resource_provider/resource_provider_unittest.cc

Issue 1882423004: Move shell service to toplevel shell namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "base/macros.h" 5 #include "base/macros.h"
6 #include "components/resource_provider/test.mojom.h" 6 #include "components/resource_provider/test.mojom.h"
7 #include "mojo/public/cpp/bindings/string.h" 7 #include "mojo/public/cpp/bindings/string.h"
8 #include "services/shell/public/cpp/shell_test.h" 8 #include "services/shell/public/cpp/shell_test.h"
9 9
10 namespace resource_provider { 10 namespace resource_provider {
11 namespace test { 11 namespace test {
12 12
13 class ResourceProviderTest : public mojo::test::ShellTest { 13 class ResourceProviderTest : public shell::test::ShellTest {
14 public: 14 public:
15 ResourceProviderTest() 15 ResourceProviderTest()
16 : mojo::test::ShellTest("exe:resource_provider_unittests") {} 16 : shell::test::ShellTest("exe:resource_provider_unittests") {}
17 ~ResourceProviderTest() override {} 17 ~ResourceProviderTest() override {}
18 18
19 private: 19 private:
20 DISALLOW_COPY_AND_ASSIGN(ResourceProviderTest); 20 DISALLOW_COPY_AND_ASSIGN(ResourceProviderTest);
21 }; 21 };
22 22
23 TEST_F(ResourceProviderTest, FetchOneResource) { 23 TEST_F(ResourceProviderTest, FetchOneResource) {
24 mojom::TestPtr test_app; 24 mojom::TestPtr test_app;
25 mojo::String resource1; 25 mojo::String resource1;
26 connector()->ConnectToInterface("mojo:resource_provider_test_app", &test_app); 26 connector()->ConnectToInterface("mojo:resource_provider_test_app", &test_app);
27 ASSERT_TRUE(test_app->GetResource1(&resource1)); 27 ASSERT_TRUE(test_app->GetResource1(&resource1));
28 EXPECT_EQ("test data\n", resource1); 28 EXPECT_EQ("test data\n", resource1);
29 } 29 }
30 30
31 TEST_F(ResourceProviderTest, FetchTwoResources) { 31 TEST_F(ResourceProviderTest, FetchTwoResources) {
32 mojom::TestPtr test_app; 32 mojom::TestPtr test_app;
33 mojo::String resource1, resource2; 33 mojo::String resource1, resource2;
34 connector()->ConnectToInterface("mojo:resource_provider_test_app", &test_app); 34 connector()->ConnectToInterface("mojo:resource_provider_test_app", &test_app);
35 ASSERT_TRUE(test_app->GetBothResources(&resource1, &resource2)); 35 ASSERT_TRUE(test_app->GetBothResources(&resource1, &resource2));
36 EXPECT_EQ("test data\n", resource1); 36 EXPECT_EQ("test data\n", resource1);
37 EXPECT_EQ("xxyy\n", resource2); 37 EXPECT_EQ("xxyy\n", resource2);
38 } 38 }
39 39
40 } // namespace test 40 } // namespace test
41 } // namespace resource_provider 41 } // namespace resource_provider
OLDNEW
« no previous file with comments | « components/resource_provider/resource_provider_test_app.cc ('k') | content/browser/browser_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698