OLD | NEW |
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 "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
8 #include "base/strings/string_split.h" | 8 #include "base/strings/string_split.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 base::DictionaryValue* request_info = new base::DictionaryValue(); | 84 base::DictionaryValue* request_info = new base::DictionaryValue(); |
85 request_info->SetInteger( | 85 request_info->SetInteger( |
86 "tabId", extensions::ExtensionTabUtil::GetTabId(web_contents())); | 86 "tabId", extensions::ExtensionTabUtil::GetTabId(web_contents())); |
87 parameters->Append(request_info); | 87 parameters->Append(request_info); |
88 parameters->AppendString(web_contents()->GetURL().GetOrigin().spec()); | 88 parameters->AppendString(web_contents()->GetURL().GetOrigin().spec()); |
89 } | 89 } |
90 | 90 |
91 bool RunFunction(UIThreadExtensionFunction* function, | 91 bool RunFunction(UIThreadExtensionFunction* function, |
92 const base::ListValue& parameters, | 92 const base::ListValue& parameters, |
93 bool expect_results) { | 93 bool expect_results) { |
94 scoped_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult( | 94 std::unique_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult( |
95 function, ParamsToString(parameters), browser())); | 95 function, ParamsToString(parameters), browser())); |
96 if (expect_results) { | 96 if (expect_results) { |
97 EXPECT_TRUE(result.get()); | 97 EXPECT_TRUE(result.get()); |
98 return result.get() != nullptr; | 98 return result.get() != nullptr; |
99 } | 99 } |
100 | 100 |
101 EXPECT_FALSE(result.get()); | 101 EXPECT_FALSE(result.get()); |
102 return result.get() == nullptr; | 102 return result.get() == nullptr; |
103 } | 103 } |
104 | 104 |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 ASSERT_TRUE(StartAudioDebugRecordings(0)); | 436 ASSERT_TRUE(StartAudioDebugRecordings(0)); |
437 ASSERT_TRUE(StopAudioDebugRecordings()); | 437 ASSERT_TRUE(StopAudioDebugRecordings()); |
438 } | 438 } |
439 | 439 |
440 IN_PROC_BROWSER_TEST_F(WebrtcLoggingPrivateApiTest, | 440 IN_PROC_BROWSER_TEST_F(WebrtcLoggingPrivateApiTest, |
441 TestStartTimedAudioDebugRecordings) { | 441 TestStartTimedAudioDebugRecordings) { |
442 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 442 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
443 switches::kEnableAudioDebugRecordingsFromExtension); | 443 switches::kEnableAudioDebugRecordingsFromExtension); |
444 ASSERT_TRUE(StartAudioDebugRecordings(1)); | 444 ASSERT_TRUE(StartAudioDebugRecordings(1)); |
445 } | 445 } |
OLD | NEW |