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

Side by Side Diff: chrome/browser/ui/webui/sync_internals_message_handler_unittest.cc

Issue 2657673004: Add shutdown notification and service refs to SyncServiceObserver. (Closed)
Patch Set: Chromeos fix Created 3 years, 10 months 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
OLDNEW
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"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 std::unique_ptr<SyncInternalsMessageHandler> handler_; 105 std::unique_ptr<SyncInternalsMessageHandler> handler_;
106 106
107 // Non-owning pointer to the about information the handler uses. This 107 // Non-owning pointer to the about information the handler uses. This
108 // extractor is owned by the handler. 108 // extractor is owned by the handler.
109 FakeExtractor* fake_extractor_; 109 FakeExtractor* fake_extractor_;
110 }; 110 };
111 111
112 } // namespace 112 } // namespace
113 113
114 TEST_F(SyncInternalsMessageHandlerTest, SendAboutInfoWithService) { 114 TEST_F(SyncInternalsMessageHandlerTest, SendAboutInfoWithService) {
115 handler()->OnStateChanged(); 115 handler()->OnStateChanged(nullptr);
116 EXPECT_EQ(1, fake_extractor()->call_count()); 116 EXPECT_EQ(1, fake_extractor()->call_count());
117 EXPECT_NE(nullptr, fake_extractor()->last_service()); 117 EXPECT_NE(nullptr, fake_extractor()->last_service());
118 EXPECT_NE(nullptr, fake_extractor()->last_signin()); 118 EXPECT_NE(nullptr, fake_extractor()->last_signin());
119 ValidateAboutInfoCall(); 119 ValidateAboutInfoCall();
120 } 120 }
121 121
122 TEST_F(SyncInternalsMessageHandlerTest, SendAboutInfoWithoutService) { 122 TEST_F(SyncInternalsMessageHandlerTest, SendAboutInfoWithoutService) {
123 base::CommandLine::ForCurrentProcess()->AppendSwitch(switches::kDisableSync); 123 base::CommandLine::ForCurrentProcess()->AppendSwitch(switches::kDisableSync);
124 handler()->OnStateChanged(); 124 handler()->OnStateChanged(nullptr);
125 EXPECT_EQ(1, fake_extractor()->call_count()); 125 EXPECT_EQ(1, fake_extractor()->call_count());
126 EXPECT_EQ(nullptr, fake_extractor()->last_service()); 126 EXPECT_EQ(nullptr, fake_extractor()->last_service());
127 EXPECT_EQ(nullptr, fake_extractor()->last_signin()); 127 EXPECT_EQ(nullptr, fake_extractor()->last_signin());
128 ValidateAboutInfoCall(); 128 ValidateAboutInfoCall();
129 } 129 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/sync_internals_message_handler.cc ('k') | components/browser_sync/profile_sync_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698