| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "sync/notifier/chrome_system_resources.h" | 5 #include "sync/notifier/chrome_system_resources.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 13 | 13 |
| 14 #include "google/cacheinvalidation/include/types.h" | 14 #include "google/cacheinvalidation/include/types.h" |
| 15 #include "jingle/notifier/listener/fake_push_client.h" | 15 #include "jingle/notifier/listener/fake_push_client.h" |
| 16 #include "sync/notifier/state_writer.h" | 16 #include "sync/notifier/state_writer.h" |
| 17 #include "testing/gmock/include/gmock/gmock.h" | 17 #include "testing/gmock/include/gmock/gmock.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 19 | 19 |
| 20 namespace csync { | 20 namespace syncer { |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 using ::testing::_; | 23 using ::testing::_; |
| 24 using ::testing::SaveArg; | 24 using ::testing::SaveArg; |
| 25 | 25 |
| 26 class MockStateWriter : public StateWriter { | 26 class MockStateWriter : public StateWriter { |
| 27 public: | 27 public: |
| 28 MOCK_METHOD1(WriteState, void(const std::string&)); | 28 MOCK_METHOD1(WriteState, void(const std::string&)); |
| 29 }; | 29 }; |
| 30 | 30 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 "fake-failure"); | 167 "fake-failure"); |
| 168 EXPECT_CALL(mock_storage_callback, Run(_)) | 168 EXPECT_CALL(mock_storage_callback, Run(_)) |
| 169 .WillOnce(SaveArg<0>(&results)); | 169 .WillOnce(SaveArg<0>(&results)); |
| 170 chrome_system_resources_.storage()->WriteKey( | 170 chrome_system_resources_.storage()->WriteKey( |
| 171 "", "state", mock_storage_callback.CreateCallback()); | 171 "", "state", mock_storage_callback.CreateCallback()); |
| 172 message_loop_.RunAllPending(); | 172 message_loop_.RunAllPending(); |
| 173 EXPECT_EQ(invalidation::Status(invalidation::Status::SUCCESS, ""), results); | 173 EXPECT_EQ(invalidation::Status(invalidation::Status::SUCCESS, ""), results); |
| 174 } | 174 } |
| 175 | 175 |
| 176 } // namespace | 176 } // namespace |
| 177 } // namespace notifier | 177 } // namespace syncer |
| OLD | NEW |