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 {
explicit HistoryObserver(Profile* profile)
: profile_(profile),
waiting_(false),
seen_stored_(false),
minimum_received_bytes_(kNoMinimumReceivedBytes) {
seen_stored_(false) {
DownloadCoreServiceFactory::GetForBrowserContext(profile_)
->GetDownloadHistory()
->AddObserver(this);
......@@ -371,10 +370,6 @@ class HistoryObserver : public DownloadHistory::Observer {
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) {
callback_ = callback;
}
......@@ -384,11 +379,6 @@ class HistoryObserver : public DownloadHistory::Observer {
if (!callback_.is_null() && (!callback_.Run(info)))
return;
if (minimum_received_bytes_ != kNoMinimumReceivedBytes &&
info.received_bytes < minimum_received_bytes_) {
return;
}
seen_stored_ = true;
if (waiting_)
base::RunLoop::QuitCurrentWhenIdleDeprecated();
......@@ -409,11 +399,9 @@ class HistoryObserver : public DownloadHistory::Observer {
}
private:
static const int64_t kNoMinimumReceivedBytes = -1;
Profile* profile_;
bool waiting_;
bool seen_stored_;
int64_t minimum_received_bytes_;
FilterCallback callback_;
DISALLOW_COPY_AND_ASSIGN(HistoryObserver);
......@@ -1855,7 +1843,13 @@ ServerRedirectRequestHandler(const net::test_server::HttpRequest& request) {
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.
embedded_test_server()->RegisterRequestHandler(
base::Bind(&ServerRedirectRequestHandler));
......@@ -1890,8 +1884,6 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadHistoryCheck) {
base::Time start(base::Time::Now());
HistoryObserver observer(browser()->profile());
observer.SetFilterCallback(base::Bind(&HasDataAndName));
observer.set_minimum_received_bytes(
content::SlowDownloadHttpResponse::kFirstDownloadSize);
ui_test_utils::NavigateToURL(browser(), redirect_url);
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