OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include "base/containers/scoped_ptr_hash_map.h" | 8 #include "base/containers/scoped_ptr_hash_map.h" |
9 #include "base/files/file.h" | 9 #include "base/files/file.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 } | 66 } |
67 return results; | 67 return results; |
68 } | 68 } |
69 | 69 |
70 // ApplicationTestBase: | 70 // ApplicationTestBase: |
71 void SetUp() override { | 71 void SetUp() override { |
72 ApplicationTestBase::SetUp(); | 72 ApplicationTestBase::SetUp(); |
73 } | 73 } |
74 | 74 |
75 private: | 75 private: |
76 MOJO_DISALLOW_COPY_AND_ASSIGN(ResourceProviderApplicationTest); | 76 DISALLOW_COPY_AND_ASSIGN(ResourceProviderApplicationTest); |
77 }; | 77 }; |
78 | 78 |
79 TEST_F(ResourceProviderApplicationTest, FetchOneResource) { | 79 TEST_F(ResourceProviderApplicationTest, FetchOneResource) { |
80 ResourceContentsMap results(GetResources(SetWithString("sample"))); | 80 ResourceContentsMap results(GetResources(SetWithString("sample"))); |
81 ASSERT_TRUE(results.count("sample") > 0u); | 81 ASSERT_TRUE(results.count("sample") > 0u); |
82 EXPECT_EQ("test data\n", results["sample"]); | 82 EXPECT_EQ("test data\n", results["sample"]); |
83 } | 83 } |
84 | 84 |
85 TEST_F(ResourceProviderApplicationTest, FetchTwoResources) { | 85 TEST_F(ResourceProviderApplicationTest, FetchTwoResources) { |
86 ResourceContentsMap results( | 86 ResourceContentsMap results( |
87 GetResources(SetWithStrings("sample", "dir/sample2"))); | 87 GetResources(SetWithStrings("sample", "dir/sample2"))); |
88 ASSERT_TRUE(results.count("sample") > 0u); | 88 ASSERT_TRUE(results.count("sample") > 0u); |
89 EXPECT_EQ("test data\n", results["sample"]); | 89 EXPECT_EQ("test data\n", results["sample"]); |
90 | 90 |
91 ASSERT_TRUE(results.count("dir/sample2") > 0u); | 91 ASSERT_TRUE(results.count("dir/sample2") > 0u); |
92 EXPECT_EQ("xxyy\n", results["dir/sample2"]); | 92 EXPECT_EQ("xxyy\n", results["dir/sample2"]); |
93 } | 93 } |
94 | 94 |
95 } // namespace | 95 } // namespace |
96 } // namespace resource_provider | 96 } // namespace resource_provider |
OLD | NEW |