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

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

Issue 20247003: Introduced base class for WebRTC browser tests, cleaned up duplication. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/media/webrtc_browsertest_base.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_common.h" 5 #include "chrome/browser/media/webrtc_browsertest_common.h"
6 6
7 #include "base/file_util.h"
8 #include "base/path_service.h" 7 #include "base/path_service.h"
9 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
10 #include "base/test/test_timeouts.h" 9 #include "base/test/test_timeouts.h"
11 #include "base/time/time.h" 10 #include "base/time/time.h"
12 #include "chrome/browser/chrome_notification_types.h"
13 #include "chrome/browser/infobars/infobar.h"
14 #include "chrome/browser/infobars/infobar_service.h"
15 #include "chrome/browser/media/media_stream_infobar_delegate.h"
16 #include "chrome/browser/profiles/profile.h" 11 #include "chrome/browser/profiles/profile.h"
17 #include "chrome/browser/ui/browser.h"
18 #include "chrome/browser/ui/browser_tabstrip.h" 12 #include "chrome/browser/ui/browser_tabstrip.h"
19 #include "chrome/browser/ui/tabs/tab_strip_model.h"
20 #include "chrome/common/chrome_switches.h"
21 #include "chrome/test/base/in_process_browser_test.h"
22 #include "chrome/test/base/ui_test_utils.h"
23 #include "chrome/test/ui/ui_test.h"
24 #include "content/public/browser/notification_service.h"
25 #include "content/public/test/browser_test_utils.h" 13 #include "content/public/test/browser_test_utils.h"
26 #include "net/test/embedded_test_server/embedded_test_server.h"
27 14
28 const int kDefaultPollIntervalMsec = 250; 15 const int kDefaultPollIntervalMsec = 250;
29 16
30 bool SleepInJavascript(content::WebContents* tab_contents, int timeout_msec) { 17 bool SleepInJavascript(content::WebContents* tab_contents, int timeout_msec) {
31 const std::string javascript = base::StringPrintf( 18 const std::string javascript = base::StringPrintf(
32 "setTimeout(function() {" 19 "setTimeout(function() {"
33 " window.domAutomationController.send('sleep-ok');" 20 " window.domAutomationController.send('sleep-ok');"
34 "}, %d)", timeout_msec); 21 "}, %d)", timeout_msec);
35 22
36 std::string result; 23 std::string result;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 // TODO(phoglund): Figure out why this fails every now and then. 57 // TODO(phoglund): Figure out why this fails every now and then.
71 // It's not a huge deal if it does though. 58 // It's not a huge deal if it does though.
72 LOG(ERROR) << "Failed to sleep."; 59 LOG(ERROR) << "Failed to sleep.";
73 } 60 }
74 } 61 }
75 LOG(ERROR) << "Timed out while waiting for " << javascript << 62 LOG(ERROR) << "Timed out while waiting for " << javascript <<
76 " to evaluate to " << evaluates_to << "; last result was '" << result << 63 " to evaluate to " << evaluates_to << "; last result was '" << result <<
77 "'"; 64 "'";
78 return false; 65 return false;
79 } 66 }
OLDNEW
« no previous file with comments | « chrome/browser/media/webrtc_browsertest_base.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698