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

Side by Side Diff: chrome/browser/ui/webui/settings/reset_settings_handler_unittest.cc

Issue 2411383003: md-settings: add reset request origin to reset feedback proto. (Closed)
Patch Set: Addressed dbeam@'s comments Created 4 years, 2 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/google/google_brand.h" 9 #include "chrome/browser/google/google_brand.h"
10 #include "chrome/browser/profile_resetter/profile_resetter.h" 10 #include "chrome/browser/profile_resetter/profile_resetter.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 TestingProfile profile_; 85 TestingProfile profile_;
86 content::TestWebUI web_ui_; 86 content::TestWebUI web_ui_;
87 std::unique_ptr<TestingResetSettingsHandler> handler_; 87 std::unique_ptr<TestingResetSettingsHandler> handler_;
88 }; 88 };
89 89
90 TEST_F(ResetSettingsHandlerTest, HandleResetProfileSettings) { 90 TEST_F(ResetSettingsHandlerTest, HandleResetProfileSettings) {
91 base::ListValue list; 91 base::ListValue list;
92 std::string expected_callback_id("dummyCallbackId"); 92 std::string expected_callback_id("dummyCallbackId");
93 list.AppendString(expected_callback_id); 93 list.AppendString(expected_callback_id);
94 list.AppendBoolean(false); 94 list.AppendBoolean(false);
95 list.AppendString("");
95 handler()->HandleResetProfileSettings(&list); 96 handler()->HandleResetProfileSettings(&list);
96 // Check that the delegate ProfileResetter was called. 97 // Check that the delegate ProfileResetter was called.
97 EXPECT_EQ(1u, handler()->resets()); 98 EXPECT_EQ(1u, handler()->resets());
98 // Check that Javascript side is notified after resetting is done. 99 // Check that Javascript side is notified after resetting is done.
99 EXPECT_EQ("cr.webUIResponse", 100 EXPECT_EQ("cr.webUIResponse",
100 web_ui()->call_data()[0]->function_name()); 101 web_ui()->call_data()[0]->function_name());
101 std::string callback_id; 102 std::string callback_id;
102 EXPECT_TRUE(web_ui()->call_data()[0]->arg1()->GetAsString(&callback_id)); 103 EXPECT_TRUE(web_ui()->call_data()[0]->arg1()->GetAsString(&callback_id));
103 EXPECT_EQ(expected_callback_id, callback_id); 104 EXPECT_EQ(expected_callback_id, callback_id);
104 } 105 }
105 106
106 } // namespace 107 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/settings/reset_settings_handler.cc ('k') | chrome/test/data/webui/settings/reset_page_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698