OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "base/macros.h" | |
6 #include "components/resource_provider/test.mojom.h" | |
7 #include "mojo/public/cpp/bindings/string.h" | |
8 #include "services/shell/public/cpp/shell_test.h" | |
9 | |
10 namespace resource_provider { | |
11 namespace test { | |
12 | |
13 class ResourceProviderTest : public shell::test::ShellTest { | |
14 public: | |
15 ResourceProviderTest() | |
16 : shell::test::ShellTest("exe:resource_provider_unittests") {} | |
17 ~ResourceProviderTest() override {} | |
18 | |
19 private: | |
20 DISALLOW_COPY_AND_ASSIGN(ResourceProviderTest); | |
21 }; | |
22 | |
23 TEST_F(ResourceProviderTest, FetchOneResource) { | |
24 mojom::TestPtr test_app; | |
25 mojo::String resource1; | |
26 connector()->ConnectToInterface("mojo:resource_provider_test_app", &test_app); | |
27 ASSERT_TRUE(test_app->GetResource1(&resource1)); | |
28 EXPECT_EQ("test data\n", resource1); | |
29 } | |
30 | |
31 TEST_F(ResourceProviderTest, FetchTwoResources) { | |
32 mojom::TestPtr test_app; | |
33 mojo::String resource1, resource2; | |
34 connector()->ConnectToInterface("mojo:resource_provider_test_app", &test_app); | |
35 ASSERT_TRUE(test_app->GetBothResources(&resource1, &resource2)); | |
36 EXPECT_EQ("test data\n", resource1); | |
37 EXPECT_EQ("xxyy\n", resource2); | |
38 } | |
39 | |
40 } // namespace test | |
41 } // namespace resource_provider | |
OLD | NEW |