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

Side by Side Diff: content/public/test/test_web_ui.cc

Issue 2269963003: Site Settings Desktop: Fix bug with deleting manually added exceptions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback Created 4 years, 3 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
« no previous file with comments | « content/public/test/test_web_ui.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/logging.h" 5 #include "base/logging.h"
6 #include "content/public/browser/web_ui_message_handler.h" 6 #include "content/public/browser/web_ui_message_handler.h"
7 #include "content/public/test/test_web_ui.h" 7 #include "content/public/test/test_web_ui.h"
8 8
9 namespace content { 9 namespace content {
10 10
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 return true; 55 return true;
56 } 56 }
57 57
58 void TestWebUI::CallJavascriptFunctionUnsafe(const std::string& function_name) { 58 void TestWebUI::CallJavascriptFunctionUnsafe(const std::string& function_name) {
59 call_data_.push_back(new CallData(function_name)); 59 call_data_.push_back(new CallData(function_name));
60 } 60 }
61 61
62 void TestWebUI::CallJavascriptFunctionUnsafe(const std::string& function_name, 62 void TestWebUI::CallJavascriptFunctionUnsafe(const std::string& function_name,
63 const base::Value& arg1) { 63 const base::Value& arg1) {
64 call_data_.push_back(new CallData(function_name)); 64 call_data_.push_back(new CallData(function_name));
65 call_data_.back()->TakeAsArg1(arg1.DeepCopy()); 65 call_data_.back()->TakeAsArg1(arg1.CreateDeepCopy());
66 } 66 }
67 67
68 void TestWebUI::CallJavascriptFunctionUnsafe(const std::string& function_name, 68 void TestWebUI::CallJavascriptFunctionUnsafe(const std::string& function_name,
69 const base::Value& arg1, 69 const base::Value& arg1,
70 const base::Value& arg2) { 70 const base::Value& arg2) {
71 call_data_.push_back(new CallData(function_name)); 71 call_data_.push_back(new CallData(function_name));
72 call_data_.back()->TakeAsArg1(arg1.DeepCopy()); 72 call_data_.back()->TakeAsArg1(arg1.CreateDeepCopy());
73 call_data_.back()->TakeAsArg2(arg2.DeepCopy()); 73 call_data_.back()->TakeAsArg2(arg2.CreateDeepCopy());
74 } 74 }
75 75
76 void TestWebUI::CallJavascriptFunctionUnsafe(const std::string& function_name, 76 void TestWebUI::CallJavascriptFunctionUnsafe(const std::string& function_name,
77 const base::Value& arg1, 77 const base::Value& arg1,
78 const base::Value& arg2, 78 const base::Value& arg2,
79 const base::Value& arg3) { 79 const base::Value& arg3) {
80 call_data_.push_back(new CallData(function_name)); 80 call_data_.push_back(new CallData(function_name));
81 call_data_.back()->TakeAsArg1(arg1.DeepCopy()); 81 call_data_.back()->TakeAsArg1(arg1.CreateDeepCopy());
82 call_data_.back()->TakeAsArg2(arg2.DeepCopy()); 82 call_data_.back()->TakeAsArg2(arg2.CreateDeepCopy());
83 call_data_.back()->TakeAsArg3(arg3.DeepCopy()); 83 call_data_.back()->TakeAsArg3(arg3.CreateDeepCopy());
84 } 84 }
85 85
86 void TestWebUI::CallJavascriptFunctionUnsafe(const std::string& function_name, 86 void TestWebUI::CallJavascriptFunctionUnsafe(const std::string& function_name,
87 const base::Value& arg1, 87 const base::Value& arg1,
88 const base::Value& arg2, 88 const base::Value& arg2,
89 const base::Value& arg3, 89 const base::Value& arg3,
90 const base::Value& arg4) { 90 const base::Value& arg4) {
91 NOTREACHED(); 91 call_data_.push_back(new CallData(function_name));
92 call_data_.back()->TakeAsArg1(arg1.CreateDeepCopy());
93 call_data_.back()->TakeAsArg2(arg2.CreateDeepCopy());
94 call_data_.back()->TakeAsArg3(arg3.CreateDeepCopy());
95 call_data_.back()->TakeAsArg4(arg4.CreateDeepCopy());
92 } 96 }
93 97
94 void TestWebUI::CallJavascriptFunctionUnsafe( 98 void TestWebUI::CallJavascriptFunctionUnsafe(
95 const std::string& function_name, 99 const std::string& function_name,
96 const std::vector<const base::Value*>& args) { 100 const std::vector<const base::Value*>& args) {
97 NOTREACHED(); 101 NOTREACHED();
98 } 102 }
99 103
100 ScopedVector<WebUIMessageHandler>* TestWebUI::GetHandlersForTesting() { 104 ScopedVector<WebUIMessageHandler>* TestWebUI::GetHandlersForTesting() {
101 return &handlers_; 105 return &handlers_;
102 } 106 }
103 107
104 TestWebUI::CallData::CallData(const std::string& function_name) 108 TestWebUI::CallData::CallData(const std::string& function_name)
105 : function_name_(function_name) { 109 : function_name_(function_name) {
106 } 110 }
107 111
108 TestWebUI::CallData::~CallData() { 112 TestWebUI::CallData::~CallData() {
109 } 113 }
110 114
111 void TestWebUI::CallData::TakeAsArg1(base::Value* arg) { 115 void TestWebUI::CallData::TakeAsArg1(std::unique_ptr<base::Value> arg) {
112 arg1_.reset(arg); 116 arg1_ = std::move(arg);
113 } 117 }
114 118
115 void TestWebUI::CallData::TakeAsArg2(base::Value* arg) { 119 void TestWebUI::CallData::TakeAsArg2(std::unique_ptr<base::Value> arg) {
116 arg2_.reset(arg); 120 arg2_ = std::move(arg);
117 } 121 }
118 122
119 void TestWebUI::CallData::TakeAsArg3(base::Value* arg) { 123 void TestWebUI::CallData::TakeAsArg3(std::unique_ptr<base::Value> arg) {
120 arg3_.reset(arg); 124 arg3_ = std::move(arg);
125 }
126
127 void TestWebUI::CallData::TakeAsArg4(std::unique_ptr<base::Value> arg) {
128 arg4_ = std::move(arg);
121 } 129 }
122 130
123 } // namespace content 131 } // namespace content
OLDNEW
« no previous file with comments | « content/public/test/test_web_ui.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698