Commit cf116cc7 authored by Xing Liu's avatar Xing Liu Committed by Commit Bot

Revert "Fix DownloadHistoryCheck on windows continuous builder."

This reverts commit 2dcec349.

Reason for revert: Still flaky, see
https://bugs.chromium.org/p/chromium/issues/detail?id=791213

Original change's description:
> Fix DownloadHistoryCheck on windows continuous builder.
> 
> Currently it's flaky that a partial buffer is read through network
> pipeline when the first history db record is generated.
> 
> This CL changed the observer to be able to optionally wait for a
> certain number of bytes read from network IO.
> 
> Bug: 788160
> Change-Id: I110653433e8c80c2dabf9f3162df99d7bb354e86
> Reviewed-on: https://chromium-review.googlesource.com/790946
> Reviewed-by: Min Qin <qinmin@chromium.org>
> Commit-Queue: Xing Liu <xingliu@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#519930}

TBR=dtrainor@chromium.org,qinmin@chromium.org,xingliu@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 788160
Change-Id: If59f7f82c7bd2a75bbc4655f665fc9f9581e170e
Reviewed-on: https://chromium-review.googlesource.com/804648Reviewed-by: default avatarXing Liu <xingliu@chromium.org>
Commit-Queue: Xing Liu <xingliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521233}
parent 230ea2c9
...@@ -357,8 +357,7 @@ class HistoryObserver : public DownloadHistory::Observer { ...@@ -357,8 +357,7 @@ class HistoryObserver : public DownloadHistory::Observer {
explicit HistoryObserver(Profile* profile) explicit HistoryObserver(Profile* profile)
: profile_(profile), : profile_(profile),
waiting_(false), waiting_(false),
seen_stored_(false), seen_stored_(false) {
minimum_received_bytes_(kNoMinimumReceivedBytes) {
DownloadCoreServiceFactory::GetForBrowserContext(profile_) DownloadCoreServiceFactory::GetForBrowserContext(profile_)
->GetDownloadHistory() ->GetDownloadHistory()
->AddObserver(this); ->AddObserver(this);
...@@ -371,10 +370,6 @@ class HistoryObserver : public DownloadHistory::Observer { ...@@ -371,10 +370,6 @@ class HistoryObserver : public DownloadHistory::Observer {
service->GetDownloadHistory()->RemoveObserver(this); service->GetDownloadHistory()->RemoveObserver(this);
} }
void set_minimum_received_bytes(int64_t minimum_received_bytes) {
minimum_received_bytes_ = minimum_received_bytes;
}
void SetFilterCallback(const FilterCallback& callback) { void SetFilterCallback(const FilterCallback& callback) {
callback_ = callback; callback_ = callback;
} }
...@@ -384,11 +379,6 @@ class HistoryObserver : public DownloadHistory::Observer { ...@@ -384,11 +379,6 @@ class HistoryObserver : public DownloadHistory::Observer {
if (!callback_.is_null() && (!callback_.Run(info))) if (!callback_.is_null() && (!callback_.Run(info)))
return; return;
if (minimum_received_bytes_ != kNoMinimumReceivedBytes &&
info.received_bytes < minimum_received_bytes_) {
return;
}
seen_stored_ = true; seen_stored_ = true;
if (waiting_) if (waiting_)
base::RunLoop::QuitCurrentWhenIdleDeprecated(); base::RunLoop::QuitCurrentWhenIdleDeprecated();
...@@ -409,11 +399,9 @@ class HistoryObserver : public DownloadHistory::Observer { ...@@ -409,11 +399,9 @@ class HistoryObserver : public DownloadHistory::Observer {
} }
private: private:
static const int64_t kNoMinimumReceivedBytes = -1;
Profile* profile_; Profile* profile_;
bool waiting_; bool waiting_;
bool seen_stored_; bool seen_stored_;
int64_t minimum_received_bytes_;
FilterCallback callback_; FilterCallback callback_;
DISALLOW_COPY_AND_ASSIGN(HistoryObserver); DISALLOW_COPY_AND_ASSIGN(HistoryObserver);
...@@ -1855,7 +1843,13 @@ ServerRedirectRequestHandler(const net::test_server::HttpRequest& request) { ...@@ -1855,7 +1843,13 @@ ServerRedirectRequestHandler(const net::test_server::HttpRequest& request) {
return std::move(response); return std::move(response);
} }
IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadHistoryCheck) { #if defined(OS_WIN)
// https://crbug.com/788160
#define MAYBE_DownloadHistoryCheck DISABLED_DownloadHistoryCheck
#else
#define MAYBE_DownloadHistoryCheck DownloadHistoryCheck
#endif
IN_PROC_BROWSER_TEST_F(DownloadTest, MAYBE_DownloadHistoryCheck) {
// Rediret to the actual download URL. // Rediret to the actual download URL.
embedded_test_server()->RegisterRequestHandler( embedded_test_server()->RegisterRequestHandler(
base::Bind(&ServerRedirectRequestHandler)); base::Bind(&ServerRedirectRequestHandler));
...@@ -1890,8 +1884,6 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadHistoryCheck) { ...@@ -1890,8 +1884,6 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadHistoryCheck) {
base::Time start(base::Time::Now()); base::Time start(base::Time::Now());
HistoryObserver observer(browser()->profile()); HistoryObserver observer(browser()->profile());
observer.SetFilterCallback(base::Bind(&HasDataAndName)); observer.SetFilterCallback(base::Bind(&HasDataAndName));
observer.set_minimum_received_bytes(
content::SlowDownloadHttpResponse::kFirstDownloadSize);
ui_test_utils::NavigateToURL(browser(), redirect_url); ui_test_utils::NavigateToURL(browser(), redirect_url);
observer.WaitForStored(); observer.WaitForStored();
......
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