| Index: chrome/browser/media/webrtc_browsertest_common.cc
|
| diff --git a/chrome/browser/media/webrtc_browsertest_common.cc b/chrome/browser/media/webrtc_browsertest_common.cc
|
| index 34298f2a061a9cbcbaf34604d4ccd99b3330d83a..635b8182678ebc4973602f7a0e33e2a45ef2ebbb 100644
|
| --- a/chrome/browser/media/webrtc_browsertest_common.cc
|
| +++ b/chrome/browser/media/webrtc_browsertest_common.cc
|
| @@ -6,6 +6,7 @@
|
|
|
| #include "base/files/file_util.h"
|
| #include "base/path_service.h"
|
| +#include "base/strings/string_util.h"
|
| #include "base/strings/stringprintf.h"
|
| #include "base/test/test_timeouts.h"
|
| #include "base/time/time.h"
|
| @@ -38,6 +39,10 @@ static const char kAdviseOnGclientSolution[] =
|
|
|
| const int kDefaultPollIntervalMsec = 250;
|
|
|
| +bool IsErrorResult(const std::string& result) {
|
| + return StartsWithASCII(result, "failed-", false);
|
| +}
|
| +
|
| base::FilePath GetReferenceFilesDir() {
|
| base::FilePath test_data_dir;
|
| PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir);
|
| @@ -133,8 +138,12 @@ bool PollingWaitUntil(const std::string& javascript,
|
| return false;
|
| }
|
|
|
| - if (evaluates_to == result)
|
| + if (evaluates_to == result) {
|
| return true;
|
| + } else if (IsErrorResult(result)) {
|
| + LOG(ERROR) << "|" << javascript << "| returned an error: " << result;
|
| + return false;
|
| + }
|
|
|
| // Sleep a bit here to keep this loop from spinlocking too badly.
|
| if (!SleepInJavascript(tab_contents, poll_interval_msec)) {
|
|
|