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 "chrome/browser/ui/webui/sync_internals_message_handler.h" | 5 #include "chrome/browser/ui/webui/sync_internals_message_handler.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "chrome/test/base/testing_profile.h" | 12 #include "chrome/test/base/testing_profile.h" |
13 #include "components/browser_sync/common/browser_sync_switches.h" | 13 #include "components/browser_sync/common/browser_sync_switches.h" |
14 #include "components/sync_driver/about_sync_util.h" | 14 #include "components/sync/driver/about_sync_util.h" |
15 #include "components/sync_driver/sync_service.h" | 15 #include "components/sync/driver/sync_service.h" |
16 #include "content/public/browser/site_instance.h" | 16 #include "content/public/browser/site_instance.h" |
17 #include "content/public/browser/web_contents.h" | 17 #include "content/public/browser/web_contents.h" |
18 #include "content/public/test/test_browser_thread_bundle.h" | 18 #include "content/public/test/test_browser_thread_bundle.h" |
19 #include "content/public/test/test_web_ui.h" | 19 #include "content/public/test/test_web_ui.h" |
20 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
24 class TestableSyncInternalsMessageHandler : public SyncInternalsMessageHandler { | 24 class TestableSyncInternalsMessageHandler : public SyncInternalsMessageHandler { |
25 public: | 25 public: |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 } | 122 } |
123 | 123 |
124 TEST_F(SyncInternalsMessageHandlerTest, SendAboutInfoWithoutService) { | 124 TEST_F(SyncInternalsMessageHandlerTest, SendAboutInfoWithoutService) { |
125 base::CommandLine::ForCurrentProcess()->AppendSwitch(switches::kDisableSync); | 125 base::CommandLine::ForCurrentProcess()->AppendSwitch(switches::kDisableSync); |
126 handler()->OnStateChanged(); | 126 handler()->OnStateChanged(); |
127 EXPECT_EQ(1, fake_extractor()->call_count()); | 127 EXPECT_EQ(1, fake_extractor()->call_count()); |
128 EXPECT_EQ(nullptr, fake_extractor()->last_service()); | 128 EXPECT_EQ(nullptr, fake_extractor()->last_service()); |
129 EXPECT_EQ(nullptr, fake_extractor()->last_signin()); | 129 EXPECT_EQ(nullptr, fake_extractor()->last_signin()); |
130 ValidateAboutInfoCall(); | 130 ValidateAboutInfoCall(); |
131 } | 131 } |
OLD | NEW |