summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-30 20:34:18 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-30 20:34:18 +0000
commitc534ef7a7142e8cf58702e058e437686f4557e32 (patch)
tree19b5e807523414fd9df5601f22febb6e53040f4f
parent310746607b329a7a72993a1dbb069fd07861555a (diff)
downloadchromium_src-c534ef7a7142e8cf58702e058e437686f4557e32.zip
chromium_src-c534ef7a7142e8cf58702e058e437686f4557e32.tar.gz
chromium_src-c534ef7a7142e8cf58702e058e437686f4557e32.tar.bz2
Initialize quota for layout tests before running the first test.
BUG=265132 R=bauerb@chromium.org Review URL: https://codereview.chromium.org/21001005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214433 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/shell/shell_browser_main_parts.cc23
1 files changed, 20 insertions, 3 deletions
diff --git a/content/shell/shell_browser_main_parts.cc b/content/shell/shell_browser_main_parts.cc
index 0a6347f..bf7233a 100644
--- a/content/shell/shell_browser_main_parts.cc
+++ b/content/shell/shell_browser_main_parts.cc
@@ -11,6 +11,8 @@
#include "base/threading/thread.h"
#include "base/threading/thread_restrictions.h"
#include "cc/base/switches.h"
+#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/storage_partition.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/main_function_params.h"
#include "content/public/common/url_constants.h"
@@ -24,6 +26,7 @@
#include "net/base/net_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "url/gurl.h"
+#include "webkit/browser/quota/quota_manager.h"
#if defined(ENABLE_PLUGINS)
#include "content/public/browser/plugin_service.h"
@@ -43,7 +46,10 @@ namespace content {
namespace {
-static GURL GetStartupURL() {
+// Default quota for each origin is 5MB.
+const int kDefaultLayoutTestQuotaBytes = 5 * 1024 * 1024;
+
+GURL GetStartupURL() {
CommandLine* command_line = CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(switches::kContentBrowserTest))
return GURL();
@@ -126,13 +132,24 @@ void ShellBrowserMainParts::PreMainMessageLoopRun() {
gfx::Size());
}
-#if defined(ENABLE_PLUGINS)
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) {
+ quota::QuotaManager* quota_manager =
+ BrowserContext::GetDefaultStoragePartition(browser_context())
+ ->GetQuotaManager();
+ BrowserThread::PostTask(
+ BrowserThread::IO,
+ FROM_HERE,
+ base::Bind(&quota::QuotaManager::SetTemporaryGlobalOverrideQuota,
+ quota_manager,
+ kDefaultLayoutTestQuotaBytes *
+ quota::QuotaManager::kPerHostTemporaryPortion,
+ quota::QuotaCallback()));
+#if defined(ENABLE_PLUGINS)
PluginService* plugin_service = PluginService::GetInstance();
plugin_service_filter_.reset(new ShellPluginServiceFilter);
plugin_service->SetFilter(plugin_service_filter_.get());
- }
#endif
+ }
if (parameters_.ui_task) {
parameters_.ui_task->Run();