OLD | NEW |
1 // Copyright (C) 2013 Google Inc. | 1 // Copyright (C) 2013 Google Inc. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 84 |
85 EXPECT_TRUE(success_); | 85 EXPECT_TRUE(success_); |
86 EXPECT_EQ(kKey, key_); | 86 EXPECT_EQ(kKey, key_); |
87 EXPECT_FALSE(data_.empty()); | 87 EXPECT_FALSE(data_.empty()); |
88 EXPECT_NE(kEmptyData, data_); | 88 EXPECT_NE(kEmptyData, data_); |
89 } | 89 } |
90 | 90 |
91 TEST_F(RetrieverTest, MissingKeyReturnsEmptyData) { | 91 TEST_F(RetrieverTest, MissingKeyReturnsEmptyData) { |
92 static const char kMissingKey[] = "junk"; | 92 static const char kMissingKey[] = "junk"; |
93 | 93 |
94 retriever_.Retrieve(kKey, BuildCallback()); | 94 retriever_.Retrieve(kMissingKey, BuildCallback()); |
95 | 95 |
96 EXPECT_TRUE(success_); | 96 EXPECT_TRUE(success_); |
97 EXPECT_EQ(kMissingKey, key_); | 97 EXPECT_EQ(kMissingKey, key_); |
98 EXPECT_EQ(kEmptyData, data_); | 98 EXPECT_EQ(kEmptyData, data_); |
99 } | 99 } |
100 | 100 |
101 // The downloader that always fails. | 101 // The downloader that always fails. |
102 class FaultyDownloader : public Downloader { | 102 class FaultyDownloader : public Downloader { |
103 public: | 103 public: |
104 FaultyDownloader() {} | 104 FaultyDownloader() {} |
(...skipping 14 matching lines...) Expand all Loading... |
119 | 119 |
120 EXPECT_FALSE(success_); | 120 EXPECT_FALSE(success_); |
121 EXPECT_EQ(kKey, key_); | 121 EXPECT_EQ(kKey, key_); |
122 EXPECT_TRUE(data_.empty()); | 122 EXPECT_TRUE(data_.empty()); |
123 } | 123 } |
124 | 124 |
125 } // namespace | 125 } // namespace |
126 | 126 |
127 } // namespace addressinput | 127 } // namespace addressinput |
128 } // namespace i18n | 128 } // namespace i18n |
OLD | NEW |