Commit 9b8b4b68 authored by Xiaohan Wang's avatar Xiaohan Wang Committed by Commit Bot

Reland "media: MediaBrowserTest not watching for plugin crash"

This reverts commit 56d3597e and
relands the original CL.

Reason for revert: The failure (revert reason) doesn't seem to be
caused by this CL.

Original change's description:
> media: MediaBrowserTest not watching for plugin crash
>
> Now the CDM is not running in a plugin, there's no need for
> MediaBrowserTest to watch for plugin crash.

Bug: 772160
Change-Id: I387abcd37e85b703e2d0d1bf67be1f82dd68bf68
Reviewed-on: https://chromium-review.googlesource.com/1174852Reviewed-by: default avatarJohn Rummell <jrummell@chromium.org>
Reviewed-by: default avatarXiaohan Wang <xhwang@chromium.org>
Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#583304}
parent c4e3e4a1
...@@ -727,7 +727,6 @@ IN_PROC_BROWSER_TEST_P(ECKEncryptedMediaTest, InitializeCDMFail) { ...@@ -727,7 +727,6 @@ IN_PROC_BROWSER_TEST_P(ECKEncryptedMediaTest, InitializeCDMFail) {
// be closed. // be closed.
// Flaky: crbug.com/832800 // Flaky: crbug.com/832800
IN_PROC_BROWSER_TEST_P(ECKEncryptedMediaTest, DISABLED_CDMCrashDuringDecode) { IN_PROC_BROWSER_TEST_P(ECKEncryptedMediaTest, DISABLED_CDMCrashDuringDecode) {
IgnorePluginCrash();
TestNonPlaybackCases(kExternalClearKeyCrashKeySystem, TestNonPlaybackCases(kExternalClearKeyCrashKeySystem,
kEmeSessionClosedAndError); kEmeSessionClosedAndError);
} }
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include "media/base/test_data_util.h" #include "media/base/test_data_util.h"
#include "net/test/embedded_test_server/embedded_test_server.h" #include "net/test/embedded_test_server/embedded_test_server.h"
MediaBrowserTest::MediaBrowserTest() : ignore_plugin_crash_(false) {} MediaBrowserTest::MediaBrowserTest() {}
MediaBrowserTest::~MediaBrowserTest() {} MediaBrowserTest::~MediaBrowserTest() {}
...@@ -47,8 +47,7 @@ std::string MediaBrowserTest::RunTest(const GURL& gurl, ...@@ -47,8 +47,7 @@ std::string MediaBrowserTest::RunTest(const GURL& gurl,
const std::string& expected_title) { const std::string& expected_title) {
DVLOG(0) << base::TimeFormatTimeOfDayWithMilliseconds(base::Time::Now()) DVLOG(0) << base::TimeFormatTimeOfDayWithMilliseconds(base::Time::Now())
<< " Running test URL: " << gurl; << " Running test URL: " << gurl;
// Observe the web contents for plugin crashes.
Observe(browser()->tab_strip_model()->GetActiveWebContents());
content::TitleWatcher title_watcher( content::TitleWatcher title_watcher(
browser()->tab_strip_model()->GetActiveWebContents(), browser()->tab_strip_model()->GetActiveWebContents(),
base::ASCIIToUTF16(expected_title)); base::ASCIIToUTF16(expected_title));
...@@ -63,15 +62,3 @@ void MediaBrowserTest::AddWaitForTitles(content::TitleWatcher* title_watcher) { ...@@ -63,15 +62,3 @@ void MediaBrowserTest::AddWaitForTitles(content::TitleWatcher* title_watcher) {
title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(media::kError)); title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(media::kError));
title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(media::kFailed)); title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(media::kFailed));
} }
void MediaBrowserTest::PluginCrashed(const base::FilePath& plugin_path,
base::ProcessId plugin_pid) {
DVLOG(0) << "Plugin crashed: " << plugin_path.value();
if (ignore_plugin_crash_)
return;
ADD_FAILURE() << "Failing test due to plugin crash.";
}
void MediaBrowserTest::IgnorePluginCrash() {
ignore_plugin_crash_ = true;
}
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include <string> #include <string>
#include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/in_process_browser_test.h"
#include "content/public/browser/web_contents_observer.h"
#include "media/base/test_data_util.h" #include "media/base/test_data_util.h"
namespace content { namespace content {
...@@ -18,8 +17,7 @@ class TitleWatcher; ...@@ -18,8 +17,7 @@ class TitleWatcher;
// Class used to automate running media related browser tests. The functions // Class used to automate running media related browser tests. The functions
// assume that media files are located under media/ folder known to the test // assume that media files are located under media/ folder known to the test
// http server. // http server.
class MediaBrowserTest : public InProcessBrowserTest, class MediaBrowserTest : public InProcessBrowserTest {
public content::WebContentsObserver {
protected: protected:
MediaBrowserTest(); MediaBrowserTest();
~MediaBrowserTest() override; ~MediaBrowserTest() override;
...@@ -38,17 +36,6 @@ class MediaBrowserTest : public InProcessBrowserTest, ...@@ -38,17 +36,6 @@ class MediaBrowserTest : public InProcessBrowserTest,
std::string RunTest(const GURL& gurl, const std::string& expected); std::string RunTest(const GURL& gurl, const std::string& expected);
virtual void AddWaitForTitles(content::TitleWatcher* title_watcher); virtual void AddWaitForTitles(content::TitleWatcher* title_watcher);
// Fails test and sets document title to kPluginCrashed when a plugin crashes.
// If IgnorePluginCrash(true) is called then plugin crash is ignored.
void PluginCrashed(const base::FilePath& plugin_path,
base::ProcessId plugin_pid) override;
// When called, the test will ignore any plugin crashes and not fail the test.
void IgnorePluginCrash();
private:
bool ignore_plugin_crash_;
}; };
#endif // CHROME_BROWSER_MEDIA_MEDIA_BROWSERTEST_H_ #endif // CHROME_BROWSER_MEDIA_MEDIA_BROWSERTEST_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment