OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/sync/driver/sync_stopped_reporter.h" | 5 #include "components/sync/driver/sync_stopped_reporter.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
11 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
12 #include "base/test/test_simple_task_runner.h" | 12 #include "base/test/test_simple_task_runner.h" |
13 #include "base/threading/non_thread_safe.h" | 13 #include "base/threading/non_thread_safe.h" |
14 #include "components/sync/protocol/sync.pb.h" | 14 #include "components/sync/protocol/sync.pb.h" |
15 #include "net/http/http_status_code.h" | 15 #include "net/http/http_status_code.h" |
16 #include "net/url_request/test_url_fetcher_factory.h" | 16 #include "net/url_request/test_url_fetcher_factory.h" |
17 #include "net/url_request/url_request_test_util.h" | 17 #include "net/url_request/url_request_test_util.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
19 #include "url/gurl.h" | 19 #include "url/gurl.h" |
20 | 20 |
21 using browser_sync::SyncStoppedReporter; | 21 namespace syncer { |
22 | 22 |
23 const char kTestURL[] = "http://chromium.org/test"; | 23 const char kTestURL[] = "http://chromium.org/test"; |
24 const char kTestURLTrailingSlash[] = "http://chromium.org/test/"; | 24 const char kTestURLTrailingSlash[] = "http://chromium.org/test/"; |
25 const char kEventURL[] = "http://chromium.org/test/event"; | 25 const char kEventURL[] = "http://chromium.org/test/event"; |
26 | 26 |
27 const char kTestUserAgent[] = "the_fifth_element"; | 27 const char kTestUserAgent[] = "the_fifth_element"; |
28 const char kAuthToken[] = "multipass"; | 28 const char kAuthToken[] = "multipass"; |
29 const char kCacheGuid[] = "leeloo"; | 29 const char kCacheGuid[] = "leeloo"; |
30 const char kBirthday[] = "2263"; | 30 const char kBirthday[] = "2263"; |
31 | 31 |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 new base::TestSimpleTaskRunner()); | 195 new base::TestSimpleTaskRunner()); |
196 ssr.SetTimerTaskRunnerForTest(task_runner); | 196 ssr.SetTimerTaskRunnerForTest(task_runner); |
197 | 197 |
198 // Begin request. | 198 // Begin request. |
199 ssr.ReportSyncStopped(kAuthToken, kCacheGuid, kBirthday); | 199 ssr.ReportSyncStopped(kAuthToken, kCacheGuid, kBirthday); |
200 | 200 |
201 // Trigger the timeout. | 201 // Trigger the timeout. |
202 ASSERT_TRUE(task_runner->HasPendingTask()); | 202 ASSERT_TRUE(task_runner->HasPendingTask()); |
203 task_runner->RunPendingTasks(); | 203 task_runner->RunPendingTasks(); |
204 } | 204 } |
| 205 |
| 206 } // namespace syncer |
OLD | NEW |