OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Mock ServerConnectionManager class for use in client regression tests. | 5 // Mock ServerConnectionManager class for use in client regression tests. |
6 | 6 |
7 #include "chrome/browser/sync/test/engine/mock_connection_manager.h" | 7 #include "chrome/browser/sync/test/engine/mock_connection_manager.h" |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 | 10 |
| 11 #include "base/location.h" |
11 #include "base/stringprintf.h" | 12 #include "base/stringprintf.h" |
12 #include "base/tracked.h" | |
13 #include "chrome/browser/sync/engine/syncer_proto_util.h" | 13 #include "chrome/browser/sync/engine/syncer_proto_util.h" |
14 #include "chrome/browser/sync/protocol/bookmark_specifics.pb.h" | 14 #include "chrome/browser/sync/protocol/bookmark_specifics.pb.h" |
15 #include "chrome/browser/sync/test/engine/test_id_factory.h" | 15 #include "chrome/browser/sync/test/engine/test_id_factory.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
17 | 17 |
18 using browser_sync::HttpResponse; | 18 using browser_sync::HttpResponse; |
19 using browser_sync::ServerConnectionManager; | 19 using browser_sync::ServerConnectionManager; |
20 using browser_sync::ServerConnectionEventListener; | 20 using browser_sync::ServerConnectionEventListener; |
21 using browser_sync::ServerConnectionEvent; | 21 using browser_sync::ServerConnectionEvent; |
22 using browser_sync::SyncerProtoUtil; | 22 using browser_sync::SyncerProtoUtil; |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 } | 615 } |
616 | 616 |
617 void MockConnectionManager::SetServerNotReachable() { | 617 void MockConnectionManager::SetServerNotReachable() { |
618 server_status_ = HttpResponse::CONNECTION_UNAVAILABLE; | 618 server_status_ = HttpResponse::CONNECTION_UNAVAILABLE; |
619 server_reachable_ = false; | 619 server_reachable_ = false; |
620 | 620 |
621 FOR_EACH_OBSERVER(ServerConnectionEventListener, listeners_, | 621 FOR_EACH_OBSERVER(ServerConnectionEventListener, listeners_, |
622 OnServerConnectionEvent( | 622 OnServerConnectionEvent( |
623 ServerConnectionEvent(server_status_, server_reachable_))); | 623 ServerConnectionEvent(server_status_, server_reachable_))); |
624 } | 624 } |
OLD | NEW |