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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
48 const std::string& checksum, | 48 const std::string& checksum, |
49 const std::string& timestamp) { | 49 const std::string& timestamp) { |
50 return data + "\n" + "checksum=" + checksum + "\n" + "timestamp=" + timestamp; | 50 return data + "\n" + "checksum=" + checksum + "\n" + "timestamp=" + timestamp; |
51 } | 51 } |
52 | 52 |
53 } // namespace | 53 } // namespace |
54 | 54 |
55 // Tests for Retriever object. | 55 // Tests for Retriever object. |
56 class RetrieverTest : public testing::Test { | 56 class RetrieverTest : public testing::Test { |
57 protected: | 57 protected: |
58 RetrieverTest() | 58 RetrieverTest() : success_(false) { |
59 : storage_(NULL), | |
60 retriever_(), | |
61 success_(false), | |
62 key_(), | |
63 data_() { | |
Evan Stade
2014/01/28 19:23:12
leave this as is, it's a libaddressinput style thi
Dan Beam
2014/01/30 04:51:36
Done.
| |
64 ResetRetriever(FakeDownloader::kFakeDataUrl); | 59 ResetRetriever(FakeDownloader::kFakeDataUrl); |
65 } | 60 } |
66 | 61 |
67 virtual ~RetrieverTest() {} | 62 virtual ~RetrieverTest() {} |
68 | 63 |
69 scoped_ptr<Retriever::Callback> BuildCallback() { | 64 scoped_ptr<Retriever::Callback> BuildCallback() { |
70 return ::i18n::addressinput::BuildCallback( | 65 return ::i18n::addressinput::BuildCallback( |
71 this, &RetrieverTest::OnDataReady); | 66 this, &RetrieverTest::OnDataReady); |
72 } | 67 } |
73 | 68 |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
264 | 259 |
265 TEST_F(RetrieverTest, NullCallbackNoCrash) { | 260 TEST_F(RetrieverTest, NullCallbackNoCrash) { |
266 ASSERT_NO_FATAL_FAILURE( | 261 ASSERT_NO_FATAL_FAILURE( |
267 retriever_->Retrieve(kKey, scoped_ptr<Retriever::Callback>())); | 262 retriever_->Retrieve(kKey, scoped_ptr<Retriever::Callback>())); |
268 ASSERT_NO_FATAL_FAILURE( | 263 ASSERT_NO_FATAL_FAILURE( |
269 retriever_->Retrieve(kKey, scoped_ptr<Retriever::Callback>())); | 264 retriever_->Retrieve(kKey, scoped_ptr<Retriever::Callback>())); |
270 } | 265 } |
271 | 266 |
272 } // namespace addressinput | 267 } // namespace addressinput |
273 } // namespace i18n | 268 } // namespace i18n |
OLD | NEW |