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

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

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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 (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/ui/webui/sync_internals_ui.h" 5 #include "chrome/browser/ui/webui/sync_internals_ui.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 #include <string> 8 #include <string>
9 9
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 // Called by |sync_internals_ui_|'s destructor. 97 // Called by |sync_internals_ui_|'s destructor.
98 EXPECT_CALL(mock_js_controller_, 98 EXPECT_CALL(mock_js_controller_,
99 RemoveJsEventHandler(sync_internals_ui_)); 99 RemoveJsEventHandler(sync_internals_ui_));
100 sync_internals_ui_ = NULL; 100 sync_internals_ui_ = NULL;
101 web_ui_.reset(); 101 web_ui_.reset();
102 102
103 ChromeRenderViewHostTestHarness::TearDown(); 103 ChromeRenderViewHostTestHarness::TearDown();
104 } 104 }
105 105
106 StrictMock<browser_sync::MockJsController> mock_js_controller_; 106 StrictMock<browser_sync::MockJsController> mock_js_controller_;
107 scoped_ptr<TestSyncWebUI> web_ui_; 107 std::unique_ptr<TestSyncWebUI> web_ui_;
108 SyncInternalsUI* sync_internals_ui_; 108 SyncInternalsUI* sync_internals_ui_;
109 }; 109 };
110 110
111 TEST_F(SyncInternalsUITestWithService, HandleJsEvent) { 111 TEST_F(SyncInternalsUITestWithService, HandleJsEvent) {
112 EXPECT_CALL(*web_ui_, 112 EXPECT_CALL(*web_ui_,
113 ExecuteJavascript( 113 ExecuteJavascript(
114 ASCIIToUTF16("chrome.sync.testMessage.fire({});"))); 114 ASCIIToUTF16("chrome.sync.testMessage.fire({});")));
115 115
116 sync_internals_ui_->HandleJsEvent("testMessage", JsEventDetails()); 116 sync_internals_ui_->HandleJsEvent("testMessage", JsEventDetails());
117 } 117 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 // |sync_internals_ui_|'s constructor triggers all the 163 // |sync_internals_ui_|'s constructor triggers all the
164 // expectations above. 164 // expectations above.
165 web_ui_.reset(new TestSyncWebUI(web_contents())); 165 web_ui_.reset(new TestSyncWebUI(web_contents()));
166 sync_internals_ui_ = new SyncInternalsUI(web_ui_.get()); 166 sync_internals_ui_ = new SyncInternalsUI(web_ui_.get());
167 web_ui_->SetController(sync_internals_ui_); 167 web_ui_->SetController(sync_internals_ui_);
168 } 168 }
169 169
170 Mock::VerifyAndClearExpectations(profile_mock); 170 Mock::VerifyAndClearExpectations(profile_mock);
171 } 171 }
172 172
173 scoped_ptr<TestSyncWebUI> web_ui_; 173 std::unique_ptr<TestSyncWebUI> web_ui_;
174 SyncInternalsUI* sync_internals_ui_; 174 SyncInternalsUI* sync_internals_ui_;
175 }; 175 };
176 176
177 TEST_F(SyncInternalsUITestWithoutService, HandleJsEvent) { 177 TEST_F(SyncInternalsUITestWithoutService, HandleJsEvent) {
178 EXPECT_CALL(*web_ui_, 178 EXPECT_CALL(*web_ui_,
179 ExecuteJavascript( 179 ExecuteJavascript(
180 ASCIIToUTF16("chrome.sync.testMessage.fire({});"))); 180 ASCIIToUTF16("chrome.sync.testMessage.fire({});")));
181 181
182 sync_internals_ui_->HandleJsEvent("testMessage", JsEventDetails()); 182 sync_internals_ui_->HandleJsEvent("testMessage", JsEventDetails());
183 } 183 }
(...skipping 29 matching lines...) Expand all
213 ExecuteJavascript(ASCIIToUTF16(kAboutInfoCall))); 213 ExecuteJavascript(ASCIIToUTF16(kAboutInfoCall)));
214 214
215 base::ListValue args; 215 base::ListValue args;
216 sync_internals_ui_->OverrideHandleWebUIMessage( 216 sync_internals_ui_->OverrideHandleWebUIMessage(
217 GURL(), "getAboutInfo", args); 217 GURL(), "getAboutInfo", args);
218 } 218 }
219 219
220 } // namespace 220 } // namespace
221 221
222 */ 222 */
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/sync_internals_message_handler_unittest.cc ('k') | chrome/browser/ui/webui/system_info_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698