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

Side by Side Diff: extensions/browser/api_test_utils.cc

Issue 2137013005: [Extensions] Code Cleanup - Remove redundant smart-ptr get()s (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/api_test_utils.h" 5 #include "extensions/browser/api_test_utils.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 26 matching lines...) Expand all
37 : public UIThreadExtensionFunction::DelegateForTests { 37 : public UIThreadExtensionFunction::DelegateForTests {
38 public: 38 public:
39 SendResponseDelegate() {} 39 SendResponseDelegate() {}
40 40
41 virtual ~SendResponseDelegate() {} 41 virtual ~SendResponseDelegate() {}
42 42
43 bool HasResponse() { return response_.get() != NULL; } 43 bool HasResponse() { return response_.get() != NULL; }
44 44
45 bool GetResponse() { 45 bool GetResponse() {
46 EXPECT_TRUE(HasResponse()); 46 EXPECT_TRUE(HasResponse());
47 return *response_.get(); 47 return *response_;
48 } 48 }
49 49
50 void OnSendResponse(UIThreadExtensionFunction* function, 50 void OnSendResponse(UIThreadExtensionFunction* function,
51 bool success, 51 bool success,
52 bool bad_message) override { 52 bool bad_message) override {
53 ASSERT_FALSE(bad_message); 53 ASSERT_FALSE(bad_message);
54 ASSERT_FALSE(HasResponse()); 54 ASSERT_FALSE(HasResponse());
55 response_.reset(new bool); 55 response_.reset(new bool);
56 *response_ = success; 56 *response_ = success;
57 run_loop_.Quit(); 57 run_loop_.Quit();
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 function->set_include_incognito(flags & INCLUDE_INCOGNITO); 251 function->set_include_incognito(flags & INCLUDE_INCOGNITO);
252 function->RunWithValidation()->Execute(); 252 function->RunWithValidation()->Execute();
253 response_delegate.WaitForResponse(); 253 response_delegate.WaitForResponse();
254 254
255 EXPECT_TRUE(response_delegate.HasResponse()); 255 EXPECT_TRUE(response_delegate.HasResponse());
256 return response_delegate.GetResponse(); 256 return response_delegate.GetResponse();
257 } 257 }
258 258
259 } // namespace api_test_utils 259 } // namespace api_test_utils
260 } // namespace extensions 260 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/usb/usb_apitest.cc ('k') | extensions/browser/extension_throttle_simulation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698