Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Side by Side Diff: chrome/browser/chromeos/drive/drive_sync_client_unittest.cc

Issue 11360108: Start calculating new combined NetworkChangeNotifier signal (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address szym's first round of comments Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "chrome/browser/chromeos/drive/drive_sync_client.h" 5 #include "chrome/browser/chromeos/drive/drive_sync_client.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 arg1.Run(error); 49 arg1.Run(error);
50 } 50 }
51 51
52 // Action used to set mock expectations for GetFileInfoByResourceId(). 52 // Action used to set mock expectations for GetFileInfoByResourceId().
53 ACTION_P2(MockUpdateFileByResourceId, error, md5) { 53 ACTION_P2(MockUpdateFileByResourceId, error, md5) {
54 scoped_ptr<DriveEntryProto> entry_proto(new DriveEntryProto); 54 scoped_ptr<DriveEntryProto> entry_proto(new DriveEntryProto);
55 entry_proto->mutable_file_specific_info()->set_file_md5(md5); 55 entry_proto->mutable_file_specific_info()->set_file_md5(md5);
56 arg1.Run(error, FilePath(), entry_proto.Pass()); 56 arg1.Run(error, FilePath(), entry_proto.Pass());
57 } 57 }
58 58
59 class MockNetworkChangeNotifier : public net::NetworkChangeNotifier { 59 class MockNetworkChangeNotifier : public net::NetworkChangeNotifier {
szym 2012/11/27 22:22:05 ditto
60 public: 60 public:
61 MockNetworkChangeNotifier()
62 : net::NetworkChangeNotifier(
63 net:NetworkChangeNotifier::NetworkChangeCalculatorParams()) {
64 }
65
61 MOCK_CONST_METHOD0(GetCurrentConnectionType, 66 MOCK_CONST_METHOD0(GetCurrentConnectionType,
62 net::NetworkChangeNotifier::ConnectionType()); 67 net::NetworkChangeNotifier::ConnectionType());
63 }; 68 };
64 69
65 class TestObserver : public DriveSyncClientObserver { 70 class TestObserver : public DriveSyncClientObserver {
66 public: 71 public:
67 // Type for recording sync client observer notifications. 72 // Type for recording sync client observer notifications.
68 enum State { 73 enum State {
69 UNINITIALIZED, 74 UNINITIALIZED,
70 STARTED, 75 STARTED,
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 EXPECT_EQ(TestObserver::STOPPED, observer_.state()); 705 EXPECT_EQ(TestObserver::STOPPED, observer_.state());
701 706
702 // So as the resume from the disconnection. 707 // So as the resume from the disconnection.
703 SetExpectationForGetFileByResourceId("resource_id_bar"); 708 SetExpectationForGetFileByResourceId("resource_id_bar");
704 SetExpectationForGetFileByResourceId("resource_id_buz"); 709 SetExpectationForGetFileByResourceId("resource_id_buz");
705 ConnectToWifi(); 710 ConnectToWifi();
706 EXPECT_EQ(TestObserver::IDLE, observer_.state()); 711 EXPECT_EQ(TestObserver::IDLE, observer_.state());
707 } 712 }
708 713
709 } // namespace drive 714 } // namespace drive
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698