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

Side by Side Diff: chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_apitest.cc

Issue 2152373003: [Extensions] Code Cleanup - Remove redundant smart-ptr get()s (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 parameters->AppendString(web_contents()->GetURL().GetOrigin().spec()); 93 parameters->AppendString(web_contents()->GetURL().GetOrigin().spec());
94 } 94 }
95 95
96 bool RunFunction(UIThreadExtensionFunction* function, 96 bool RunFunction(UIThreadExtensionFunction* function,
97 const base::ListValue& parameters, 97 const base::ListValue& parameters,
98 bool expect_results) { 98 bool expect_results) {
99 std::unique_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult( 99 std::unique_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult(
100 function, ParamsToString(parameters), browser())); 100 function, ParamsToString(parameters), browser()));
101 if (expect_results) { 101 if (expect_results) {
102 EXPECT_TRUE(result.get()); 102 EXPECT_TRUE(result.get());
103 return result.get() != nullptr; 103 return result != nullptr;
104 } 104 }
105 105
106 EXPECT_FALSE(result.get()); 106 EXPECT_FALSE(result.get());
107 return result.get() == nullptr; 107 return result == nullptr;
108 } 108 }
109 109
110 template<typename Function> 110 template<typename Function>
111 bool RunFunction(const base::ListValue& parameters, bool expect_results) { 111 bool RunFunction(const base::ListValue& parameters, bool expect_results) {
112 scoped_refptr<Function> function(CreateFunction<Function>()); 112 scoped_refptr<Function> function(CreateFunction<Function>());
113 return RunFunction(function.get(), parameters, expect_results); 113 return RunFunction(function.get(), parameters, expect_results);
114 } 114 }
115 115
116 template<typename Function> 116 template<typename Function>
117 bool RunNoArgsFunction(bool expect_results) { 117 bool RunNoArgsFunction(bool expect_results) {
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 ASSERT_TRUE(StartAudioDebugRecordings(0)); 441 ASSERT_TRUE(StartAudioDebugRecordings(0));
442 ASSERT_TRUE(StopAudioDebugRecordings()); 442 ASSERT_TRUE(StopAudioDebugRecordings());
443 } 443 }
444 444
445 IN_PROC_BROWSER_TEST_F(WebrtcLoggingPrivateApiTest, 445 IN_PROC_BROWSER_TEST_F(WebrtcLoggingPrivateApiTest,
446 TestStartTimedAudioDebugRecordings) { 446 TestStartTimedAudioDebugRecordings) {
447 base::CommandLine::ForCurrentProcess()->AppendSwitch( 447 base::CommandLine::ForCurrentProcess()->AppendSwitch(
448 switches::kEnableAudioDebugRecordingsFromExtension); 448 switches::kEnableAudioDebugRecordingsFromExtension);
449 ASSERT_TRUE(StartAudioDebugRecordings(1)); 449 ASSERT_TRUE(StartAudioDebugRecordings(1));
450 } 450 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698