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

Side by Side Diff: chrome/browser/media/webrtc_browsertest_base.cc

Issue 1349783006: Cleanup: Pass std::string as const reference if possible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert third_party changes Created 5 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 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_browsertest_base.h" 5 #include "chrome/browser/media/webrtc_browsertest_base.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "chrome/browser/media/webrtc_browsertest_common.h" 10 #include "chrome/browser/media/webrtc_browsertest_common.h"
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 base::StringPrintf("receiveOfferFromPeer('%s', {})", local_offer.c_str()); 326 base::StringPrintf("receiveOfferFromPeer('%s', {})", local_offer.c_str());
327 std::string response = ExecuteJavascript(javascript, to_tab); 327 std::string response = ExecuteJavascript(javascript, to_tab);
328 EXPECT_EQ("ok-", response.substr(0, 3)) 328 EXPECT_EQ("ok-", response.substr(0, 3))
329 << "Receiving peer failed to receive offer and create answer: " 329 << "Receiving peer failed to receive offer and create answer: "
330 << response; 330 << response;
331 331
332 std::string answer = response.substr(3); 332 std::string answer = response.substr(3);
333 return answer; 333 return answer;
334 } 334 }
335 335
336 void WebRtcTestBase::ReceiveAnswer(std::string answer, 336 void WebRtcTestBase::ReceiveAnswer(const std::string& answer,
337 content::WebContents* from_tab) const { 337 content::WebContents* from_tab) const {
338 ASSERT_EQ( 338 ASSERT_EQ(
339 "ok-accepted-answer", 339 "ok-accepted-answer",
340 ExecuteJavascript( 340 ExecuteJavascript(
341 base::StringPrintf("receiveAnswerFromPeer('%s')", answer.c_str()), 341 base::StringPrintf("receiveAnswerFromPeer('%s')", answer.c_str()),
342 from_tab)); 342 from_tab));
343 } 343 }
344 344
345 void WebRtcTestBase::GatherAndSendIceCandidates( 345 void WebRtcTestBase::GatherAndSendIceCandidates(
346 content::WebContents* from_tab, 346 content::WebContents* from_tab,
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 #endif 413 #endif
414 } 414 }
415 415
416 bool WebRtcTestBase::OnWin8() const { 416 bool WebRtcTestBase::OnWin8() const {
417 #if defined(OS_WIN) 417 #if defined(OS_WIN)
418 return base::win::GetVersion() > base::win::VERSION_WIN7; 418 return base::win::GetVersion() > base::win::VERSION_WIN7;
419 #else 419 #else
420 return false; 420 return false;
421 #endif 421 #endif
422 } 422 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698