Commit 56d3597e authored by Mark Pearson's avatar Mark Pearson Committed by Commit Bot

Revert "media: MediaBrowserTest not watching for plugin crash"

This reverts commit 73932db2.

Reason for revert: caused failure in
https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Mac10.13%20Tests/3347

failures:
MSE_ExternalClearKey/EncryptedMediaTest.Playback_VideoOnly_MP4/0

[ RUN      ] MSE_ExternalClearKey/EncryptedMediaTest.Playback_VideoOnly_MP4/0
[51235:2819:0608/103709.237938:WARNING:notification_platform_bridge_mac.mm(510)] AlertNotificationService: XPC connection invalidated.
2018-06-08 10:37:09.383 browser_tests[51235:780694] *** Owner supplied to -[NSTrackingArea initWithRect:options:owner:userInfo:] referenced a deallocating object. Tracking area behavior is undefined. Break on NSTrackingAreaDeallocatingOwnerError to debug.
BrowserTestBase received signal: Terminated: 15. Backtrace:
0   browser_tests                       0x000000010ea3aeac base::debug::StackTrace::StackTrace(unsigned long) + 28
1   browser_tests                       0x000000010efd4b45 content::(anonymous namespace)::DumpStackTraceSignalHandler(int) + 229
2   libsystem_platform.dylib            0x00007fff51ad5f5a _sigtramp + 26
3   browser_tests                       0x000000010e9b6c3f base::internal::IncomingTaskQueue::PostPendingTask(base::PendingTask*) + 111
4   CoreFoundation                      0x00007fff29e9bdc5 __CFRunLoopServiceMachPort + 341
5   CoreFoundation                      0x00007fff29e9b117 __CFRunLoopRun + 1783
6   CoreFoundation                      0x00007fff29e9a787 CFRunLoopRunSpecific + 487
7   HIToolbox                           0x00007fff291a7e26 RunCurrentEventLoopInMode + 286
8   HIToolbox                           0x00007fff291a7b96 ReceiveNextEventCommon + 613
9   HIToolbox                           0x00007fff291a7914 _BlockUntilNextEventMatchingListInModeWithFilter + 64
10  AppKit                              0x00007fff27472f5f _DPSNextEvent + 2085
11  AppKit                              0x00007fff27c08b4c -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 3044
12  browser_tests                       0x000000010eae2920 __71-[BrowserCrApplication nextEventMatchingMask:untilDate:inMode:dequeue:]_block_invoke + 64
13  browser_tests                       0x000000010e9ab94a base::mac::CallWithEHFrame(void () block_pointer) + 10
14  browser_tests                       0x000000010eae2854 -[BrowserCrApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 164
15  AppKit                              0x00007fff27467d6d -[NSApplication run] + 764
16  browser_tests                       0x000000010e9bbc0c base::MessagePumpNSApplication::DoRun(base::MessagePump::Delegate*) + 364
17  browser_tests                       0x000000010e9ba72e base::MessagePumpCFRunLoopBase::Run(base::MessagePump::Delegate*) + 110
18  browser_tests                       0x000000010e9dee55 base::RunLoop::Run() + 53
19  browser_tests                       0x000000010effa3b9 content::WindowedNotificationObserver::Wait() + 153
20  browser_tests                       0x000000010efd5959 content::WaitForLoadStop(content::WebContents*) + 105
21  browser_tests                       0x000000010ea70771 InProcessBrowserTest::PreRunTestOnMainThread() + 161
22  browser_tests                       0x000000010efd4778 content::BrowserTestBase::ProxyRunTestOnMainThreadLoop() + 280
23  browser_tests                       0x000000010eae8a45 ChromeBrowserMainParts::PreMainMessageLoopRunImpl() + 4341
24  browser_tests                       0x000000010eae784e ChromeBrowserMainParts::PreMainMessageLoopRun() + 62
25  browser_tests                       0x000000010d57f283 content::BrowserMainLoop::PreMainMessageLoopRun() + 67
26  browser_tests                       0x000000010d96b377 content::StartupTaskRunner::RunAllTasksNow() + 39
27  browser_tests                       0x000000010d57dccd content::BrowserMainLoop::CreateStartupTasks() + 813
28  browser_tests                       0x000000010d581562 content::BrowserMainRunnerImpl::Initialize(content::MainFunctionParams const&, std::__1::unique_ptr<content::BrowserProcessSubThread, std::__1::default_delete<content::BrowserProcessSubThread> >) + 98
29  browser_tests                       0x000000010d57bd4c content::BrowserMain(content::MainFunctionParams const&, std::__1::unique_ptr<content::BrowserProcessSubThread, std::__1::default_delete<content::BrowserProcessSubThread> >) + 204
30  browser_tests                       0x000000010e92fa77 content::ContentMainRunnerImpl::Run() + 615
31  browser_tests                       0x000000011060dab5 service_manager::Main(service_manager::MainParams const&) + 2709
32  browser_tests                       0x000000010e92ea74 content::ContentMain(content::ContentMainParams const&) + 68
33  browser_tests                       0x000000010efd447b content::BrowserTestBase::SetUp() + 2571
34  browser_tests                       0x000000010ea6f8d3 InProcessBrowserTest::SetUp() + 723
35  browser_tests                       0x000000010ca9350d testing::Test::Run() + 109
36  browser_tests                       0x000000010ca941a0 testing::TestInfo::Run() + 320
37  browser_tests                       0x000000010ca94717 testing::TestCase::Run() + 279
38  browser_tests                       0x000000010ca9fd87 testing::internal::UnitTestImpl::RunAllTests() + 871
39  browser_tests                       0x000000010ca9f9fd testing::UnitTest::Run() + 109
40  browser_tests                       0x000000010ea89786 base::TestSuite::Run() + 166
41  browser_tests                       0x000000010e98b2f5 ChromeTestSuiteRunner::RunTestSuite(int, char**) + 37
42  browser_tests                       0x000000010eff5f35 content::LaunchTests(content::TestLauncherDelegate*, unsigned long, int, char**) + 389
43  browser_tests                       0x000000010e98b7db LaunchChromeTests(unsigned long, content::TestLauncherDelegate*, int, char**) + 347
44  browser_tests                       0x000000010e98b26e main + 94
45  libdyld.dylib                       0x00007fff51854115 start + 1
46  ???                                 0x000000000000000a 0x0 + 10


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.
> 
> For the record, see the original CL that added this:
> https://codereview.chromium.org/206693004
> 
> Bug: 772160
> Test: Remove obsolete code. No functionality change.
> Change-Id: I8c0a9e74cc4c1d05b153f1e80a0882ee28287ac7
> Reviewed-on: https://chromium-review.googlesource.com/1091888
> Reviewed-by: Frank Liberato <liberato@chromium.org>
> Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#565649}

TBR=xhwang@chromium.org,liberato@chromium.org

Change-Id: Ib80cd4be4d495c13f19196456ac621168acfa270
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 772160
Reviewed-on: https://chromium-review.googlesource.com/1093514Reviewed-by: default avatarMark Pearson <mpearson@chromium.org>
Commit-Queue: Mark Pearson <mpearson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565702}
parent e25c04d0
......@@ -737,6 +737,7 @@ IN_PROC_BROWSER_TEST_P(ECKEncryptedMediaTest, InitializeCDMFail) {
// be closed.
// Flaky: crbug.com/832800
IN_PROC_BROWSER_TEST_P(ECKEncryptedMediaTest, DISABLED_CDMCrashDuringDecode) {
IgnorePluginCrash();
TestNonPlaybackCases(kExternalClearKeyCrashKeySystem,
kEmeSessionClosedAndError);
}
......
......@@ -17,7 +17,7 @@
#include "media/base/test_data_util.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
MediaBrowserTest::MediaBrowserTest() {}
MediaBrowserTest::MediaBrowserTest() : ignore_plugin_crash_(false) {}
MediaBrowserTest::~MediaBrowserTest() {}
......@@ -47,7 +47,8 @@ std::string MediaBrowserTest::RunTest(const GURL& gurl,
const std::string& expected_title) {
DVLOG(0) << base::TimeFormatTimeOfDayWithMilliseconds(base::Time::Now())
<< " Running test URL: " << gurl;
// Observe the web contents for plugin crashes.
Observe(browser()->tab_strip_model()->GetActiveWebContents());
content::TitleWatcher title_watcher(
browser()->tab_strip_model()->GetActiveWebContents(),
base::ASCIIToUTF16(expected_title));
......@@ -62,3 +63,15 @@ void MediaBrowserTest::AddWaitForTitles(content::TitleWatcher* title_watcher) {
title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(media::kError));
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,6 +8,7 @@
#include <string>
#include "chrome/test/base/in_process_browser_test.h"
#include "content/public/browser/web_contents_observer.h"
#include "media/base/test_data_util.h"
namespace content {
......@@ -17,7 +18,8 @@ class TitleWatcher;
// Class used to automate running media related browser tests. The functions
// assume that media files are located under media/ folder known to the test
// http server.
class MediaBrowserTest : public InProcessBrowserTest {
class MediaBrowserTest : public InProcessBrowserTest,
public content::WebContentsObserver {
protected:
MediaBrowserTest();
~MediaBrowserTest() override;
......@@ -36,6 +38,17 @@ class MediaBrowserTest : public InProcessBrowserTest {
std::string RunTest(const GURL& gurl, const std::string& expected);
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_
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