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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "chrome/browser/sync_file_system/sync_file_system_test_util.h" | 24 #include "chrome/browser/sync_file_system/sync_file_system_test_util.h" |
25 #include "chrome/browser/sync_file_system/sync_status_code.h" | 25 #include "chrome/browser/sync_file_system/sync_status_code.h" |
26 #include "chrome/browser/sync_file_system/syncable_file_system_util.h" | 26 #include "chrome/browser/sync_file_system/syncable_file_system_util.h" |
27 #include "chrome/test/base/testing_profile.h" | 27 #include "chrome/test/base/testing_profile.h" |
28 #include "content/public/browser/browser_thread.h" | 28 #include "content/public/browser/browser_thread.h" |
29 #include "content/public/test/test_browser_thread_bundle.h" | 29 #include "content/public/test/test_browser_thread_bundle.h" |
30 #include "content/public/test/test_utils.h" | 30 #include "content/public/test/test_utils.h" |
31 #include "testing/gtest/include/gtest/gtest.h" | 31 #include "testing/gtest/include/gtest/gtest.h" |
32 #include "third_party/leveldatabase/src/helpers/memenv/memenv.h" | 32 #include "third_party/leveldatabase/src/helpers/memenv/memenv.h" |
33 #include "third_party/leveldatabase/src/include/leveldb/env.h" | 33 #include "third_party/leveldatabase/src/include/leveldb/env.h" |
34 #include "webkit/browser/fileapi/file_system_context.h" | 34 #include "storage/browser/fileapi/file_system_context.h" |
35 | 35 |
36 using content::BrowserThread; | 36 using content::BrowserThread; |
37 using fileapi::FileSystemURL; | 37 using storage::FileSystemURL; |
38 using fileapi::FileSystemURLSet; | 38 using storage::FileSystemURLSet; |
39 using ::testing::AnyNumber; | 39 using ::testing::AnyNumber; |
40 using ::testing::AtLeast; | 40 using ::testing::AtLeast; |
41 using ::testing::InSequence; | 41 using ::testing::InSequence; |
42 using ::testing::InvokeWithoutArgs; | 42 using ::testing::InvokeWithoutArgs; |
43 using ::testing::Return; | 43 using ::testing::Return; |
44 using ::testing::StrictMock; | 44 using ::testing::StrictMock; |
45 using ::testing::_; | 45 using ::testing::_; |
46 | 46 |
47 namespace sync_file_system { | 47 namespace sync_file_system { |
48 | 48 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 class MockSyncEventObserver : public SyncEventObserver { | 84 class MockSyncEventObserver : public SyncEventObserver { |
85 public: | 85 public: |
86 MockSyncEventObserver() {} | 86 MockSyncEventObserver() {} |
87 virtual ~MockSyncEventObserver() {} | 87 virtual ~MockSyncEventObserver() {} |
88 | 88 |
89 MOCK_METHOD3(OnSyncStateUpdated, | 89 MOCK_METHOD3(OnSyncStateUpdated, |
90 void(const GURL& app_origin, | 90 void(const GURL& app_origin, |
91 SyncServiceState state, | 91 SyncServiceState state, |
92 const std::string& description)); | 92 const std::string& description)); |
93 MOCK_METHOD4(OnFileSynced, | 93 MOCK_METHOD4(OnFileSynced, |
94 void(const fileapi::FileSystemURL& url, | 94 void(const storage::FileSystemURL& url, |
95 SyncFileStatus status, | 95 SyncFileStatus status, |
96 SyncAction action, | 96 SyncAction action, |
97 SyncDirection direction)); | 97 SyncDirection direction)); |
98 }; | 98 }; |
99 | 99 |
100 ACTION_P3(NotifyStateAndCallback, | 100 ACTION_P3(NotifyStateAndCallback, |
101 mock_remote_service, service_state, operation_status) { | 101 mock_remote_service, service_state, operation_status) { |
102 mock_remote_service->NotifyRemoteServiceStateUpdated( | 102 mock_remote_service->NotifyRemoteServiceStateUpdated( |
103 service_state, "Test event."); | 103 service_state, "Test event."); |
104 base::ThreadTaskRunnerHandle::Get()->PostTask( | 104 base::ThreadTaskRunnerHandle::Get()->PostTask( |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 base::Bind(&AssignValueAndQuit<SyncFileStatus>, | 477 base::Bind(&AssignValueAndQuit<SyncFileStatus>, |
478 &run_loop, &status, &sync_file_status)); | 478 &run_loop, &status, &sync_file_status)); |
479 run_loop.Run(); | 479 run_loop.Run(); |
480 | 480 |
481 EXPECT_EQ(SYNC_STATUS_OK, status); | 481 EXPECT_EQ(SYNC_STATUS_OK, status); |
482 EXPECT_EQ(SYNC_FILE_STATUS_HAS_PENDING_CHANGES, sync_file_status); | 482 EXPECT_EQ(SYNC_FILE_STATUS_HAS_PENDING_CHANGES, sync_file_status); |
483 } | 483 } |
484 } | 484 } |
485 | 485 |
486 } // namespace sync_file_system | 486 } // namespace sync_file_system |
OLD | NEW |