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

Side by Side Diff: extensions/browser/api/printer_provider/printer_provider_apitest.cc

Issue 2323993004: Remove use of deprecated base::ListValue::Append(Value*) overload in extensions. (Closed)
Patch Set: ... I hate C++ 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
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 <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 30 matching lines...) Expand all
41 // |callback|. 41 // |callback|.
42 void AppendPrintersAndRunCallbackIfDone(base::ListValue* printers_out, 42 void AppendPrintersAndRunCallbackIfDone(base::ListValue* printers_out,
43 const base::Closure& callback, 43 const base::Closure& callback,
44 const base::ListValue& printers, 44 const base::ListValue& printers,
45 bool done) { 45 bool done) {
46 for (size_t i = 0; i < printers.GetSize(); ++i) { 46 for (size_t i = 0; i < printers.GetSize(); ++i) {
47 const base::DictionaryValue* printer = NULL; 47 const base::DictionaryValue* printer = NULL;
48 EXPECT_TRUE(printers.GetDictionary(i, &printer)) 48 EXPECT_TRUE(printers.GetDictionary(i, &printer))
49 << "Found invalid printer value at index " << i << ": " << printers; 49 << "Found invalid printer value at index " << i << ": " << printers;
50 if (printer) 50 if (printer)
51 printers_out->Append(printer->DeepCopy()); 51 printers_out->Append(printer->CreateDeepCopy());
52 } 52 }
53 if (done && !callback.is_null()) 53 if (done && !callback.is_null())
54 callback.Run(); 54 callback.Run();
55 } 55 }
56 56
57 // Callback for PrinterProviderAPI::DispatchPrintRequested calls. 57 // Callback for PrinterProviderAPI::DispatchPrintRequested calls.
58 // It copies |value| to |*result| and runs |callback|. 58 // It copies |value| to |*result| and runs |callback|.
59 void RecordPrintResultAndRunCallback(bool* result_success, 59 void RecordPrintResultAndRunCallback(bool* result_success,
60 std::string* result_status, 60 std::string* result_status,
61 const base::Closure& callback, 61 const base::Closure& callback,
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
857 RunUsbPrinterInfoRequestTest("EMPTY_RESPONSE"); 857 RunUsbPrinterInfoRequestTest("EMPTY_RESPONSE");
858 } 858 }
859 859
860 IN_PROC_BROWSER_TEST_F(PrinterProviderApiTest, GetUsbPrinterInfoNoListener) { 860 IN_PROC_BROWSER_TEST_F(PrinterProviderApiTest, GetUsbPrinterInfoNoListener) {
861 RunUsbPrinterInfoRequestTest("NO_LISTENER"); 861 RunUsbPrinterInfoRequestTest("NO_LISTENER");
862 } 862 }
863 863
864 } // namespace 864 } // namespace
865 865
866 } // namespace extensions 866 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/networking_private/networking_private_linux.cc ('k') | extensions/browser/api/runtime/runtime_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698