Commit 6dfb948b authored by Becca Hughes's avatar Becca Hughes Committed by Commit Bot

[Media Feeds] Fix flaky test

Fix the flaky test which was waiting for the URL
which we didn't actually need.

BUG=1060626

Change-Id: Ib29ebabf9c0ff0bf803fbc7f2af5c1dde7ac525d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2106970Reviewed-by: default avatarTommy Steimel <steimel@chromium.org>
Commit-Queue: Becca Hughes <beccahughes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#751173}
parent 8bd7794a
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include "base/task/post_task.h" #include "base/task/post_task.h"
#include "base/test/bind_test_util.h" #include "base/test/bind_test_util.h"
#include "base/test/scoped_feature_list.h" #include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "chrome/browser/media/feeds/media_feeds_contents_observer.h" #include "chrome/browser/media/feeds/media_feeds_contents_observer.h"
#include "chrome/browser/media/history/media_history_feeds_table.h" #include "chrome/browser/media/history/media_history_feeds_table.h"
#include "chrome/browser/media/history/media_history_keyed_service.h" #include "chrome/browser/media/history/media_history_keyed_service.h"
...@@ -124,31 +123,21 @@ INSTANTIATE_TEST_SUITE_P( ...@@ -124,31 +123,21 @@ INSTANTIATE_TEST_SUITE_P(
"<link rel=other type=\"application/ld+json\" href=\"/test\"/>", "<link rel=other type=\"application/ld+json\" href=\"/test\"/>",
false})); false}));
// Crashes on Mac/Win only. http://crbug.com/1060626 IN_PROC_BROWSER_TEST_P(MediaFeedsBrowserTest, Discover) {
#if defined(OS_WIN) || defined(OS_MACOSX)
#define MAYBE_Discover DISABLED_Discover
#else
#define MAYBE_Discover Discover
#endif
IN_PROC_BROWSER_TEST_P(MediaFeedsBrowserTest, MAYBE_Discover) {
EXPECT_TRUE(GetDiscoveredFeedURLs().empty()); EXPECT_TRUE(GetDiscoveredFeedURLs().empty());
MediaFeedsContentsObserver* contents_observer = MediaFeedsContentsObserver* contents_observer =
static_cast<MediaFeedsContentsObserver*>( static_cast<MediaFeedsContentsObserver*>(
MediaFeedsContentsObserver::FromWebContents(GetWebContents())); MediaFeedsContentsObserver::FromWebContents(GetWebContents()));
auto* web_contents = browser()->tab_strip_model()->GetActiveWebContents();
GURL test_url(embedded_test_server()->GetURL(kMediaFeedsTestURL)); GURL test_url(embedded_test_server()->GetURL(kMediaFeedsTestURL));
// The contents observer will call this closure when it has checked for a // The contents observer will call this closure when it has checked for a
// media feed. // media feed.
base::RunLoop run_loop; base::RunLoop run_loop;
contents_observer->SetClosureForTest(base::BindLambdaForTesting([&]() { contents_observer->SetClosureForTest(
if (web_contents->GetLastCommittedURL() == test_url) base::BindLambdaForTesting([&]() { run_loop.Quit(); }));
run_loop.Quit();
}));
ui_test_utils::NavigateToURL(browser(), test_url); ui_test_utils::NavigateToURL(browser(), test_url);
......
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