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 "chrome/browser/media/webrtc/webrtc_browsertest_base.h" | 5 #include "chrome/browser/media/webrtc/webrtc_browsertest_base.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 bool request_shown_; | 121 bool request_shown_; |
122 scoped_refptr<content::MessageLoopRunner> message_loop_runner_; | 122 scoped_refptr<content::MessageLoopRunner> message_loop_runner_; |
123 | 123 |
124 DISALLOW_COPY_AND_ASSIGN(PermissionRequestObserver); | 124 DISALLOW_COPY_AND_ASSIGN(PermissionRequestObserver); |
125 }; | 125 }; |
126 | 126 |
127 std::vector<std::string> JsonArrayToVectorOfStrings( | 127 std::vector<std::string> JsonArrayToVectorOfStrings( |
128 const std::string& json_array) { | 128 const std::string& json_array) { |
129 std::unique_ptr<base::Value> value = base::JSONReader::Read(json_array); | 129 std::unique_ptr<base::Value> value = base::JSONReader::Read(json_array); |
130 EXPECT_TRUE(value); | 130 EXPECT_TRUE(value); |
131 EXPECT_TRUE(value->IsType(base::Value::TYPE_LIST)); | 131 EXPECT_TRUE(value->IsType(base::Value::Type::LIST)); |
132 std::unique_ptr<base::ListValue> list = | 132 std::unique_ptr<base::ListValue> list = |
133 base::ListValue::From(std::move(value)); | 133 base::ListValue::From(std::move(value)); |
134 std::vector<std::string> vector; | 134 std::vector<std::string> vector; |
135 vector.reserve(list->GetSize()); | 135 vector.reserve(list->GetSize()); |
136 for (size_t i = 0; i < list->GetSize(); ++i) { | 136 for (size_t i = 0; i < list->GetSize(); ++i) { |
137 base::Value* item; | 137 base::Value* item; |
138 EXPECT_TRUE(list->Get(i, &item)); | 138 EXPECT_TRUE(list->Get(i, &item)); |
139 EXPECT_TRUE(item->IsType(base::Value::TYPE_STRING)); | 139 EXPECT_TRUE(item->IsType(base::Value::Type::STRING)); |
140 std::string item_str; | 140 std::string item_str; |
141 EXPECT_TRUE(item->GetAsString(&item_str)); | 141 EXPECT_TRUE(item->GetAsString(&item_str)); |
142 vector.push_back(std::move(item_str)); | 142 vector.push_back(std::move(item_str)); |
143 } | 143 } |
144 return vector; | 144 return vector; |
145 } | 145 } |
146 | 146 |
147 } // namespace | 147 } // namespace |
148 | 148 |
149 WebRtcTestBase::WebRtcTestBase(): detect_errors_in_javascript_(false) { | 149 WebRtcTestBase::WebRtcTestBase(): detect_errors_in_javascript_(false) { |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 void WebRtcTestBase::SetDefaultVideoCodec( | 528 void WebRtcTestBase::SetDefaultVideoCodec( |
529 content::WebContents* tab, | 529 content::WebContents* tab, |
530 const std::string& video_codec) const { | 530 const std::string& video_codec) const { |
531 EXPECT_EQ("ok", ExecuteJavascript( | 531 EXPECT_EQ("ok", ExecuteJavascript( |
532 "setDefaultVideoCodec('" + video_codec + "')", tab)); | 532 "setDefaultVideoCodec('" + video_codec + "')", tab)); |
533 } | 533 } |
534 | 534 |
535 void WebRtcTestBase::EnableOpusDtx(content::WebContents* tab) const { | 535 void WebRtcTestBase::EnableOpusDtx(content::WebContents* tab) const { |
536 EXPECT_EQ("ok-forced", ExecuteJavascript("forceOpusDtx()", tab)); | 536 EXPECT_EQ("ok-forced", ExecuteJavascript("forceOpusDtx()", tab)); |
537 } | 537 } |
OLD | NEW |