Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1240)

Unified Diff: chrome/browser/download/save_page_browsertest.cc

Issue 2168403003: Avoid file IO on UI thread by moving more save-page-as stuff to the FILE thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/download/save_package.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/save_page_browsertest.cc
diff --git a/chrome/browser/download/save_page_browsertest.cc b/chrome/browser/download/save_page_browsertest.cc
index 544d49935ad23def57a279a2ebfcfeb6611b5b31..c196bae2aba20a7325ec6cb96d425700bbe84dbb 100644
--- a/chrome/browser/download/save_page_browsertest.cc
+++ b/chrome/browser/download/save_page_browsertest.cc
@@ -20,6 +20,7 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/test_file_util.h"
+#include "base/threading/thread_restrictions.h"
#include "build/build_config.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/download/chrome_download_manager_delegate.h"
@@ -726,8 +727,10 @@ IN_PROC_BROWSER_TEST_F(SavePageAsMHTMLBrowserTest, SavePageAsMHTML) {
SavePackageFinishedObserver observer(
content::BrowserContext::GetDownloadManager(browser()->profile()),
loop_runner->QuitClosure());
+ bool old_io_allowed_value = base::ThreadRestrictions::SetIOAllowed(false);
chrome::SavePage(browser());
loop_runner->Run();
+ base::ThreadRestrictions::SetIOAllowed(old_io_allowed_value);
Łukasz Anforowicz 2016/07/26 22:30:50 I've reverted these changes in a more recent patch
ASSERT_TRUE(VerifySavePackageExpectations(browser(), url));
persisted.WaitForPersisted();
@@ -751,8 +754,10 @@ IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, SavePageBrowserTest_NonMHTML) {
SavePackageFinishedObserver observer(
content::BrowserContext::GetDownloadManager(browser()->profile()),
loop_runner->QuitClosure());
+ bool old_io_allowed_value = base::ThreadRestrictions::SetIOAllowed(false);
chrome::SavePage(browser());
loop_runner->Run();
+ base::ThreadRestrictions::SetIOAllowed(old_io_allowed_value);
base::FilePath download_dir = DownloadPrefs::FromDownloadManager(
GetDownloadManager())->DownloadPath();
base::FilePath filename = download_dir.AppendASCII("dataurl.txt");
« no previous file with comments | « no previous file | content/browser/download/save_package.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698