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

Unified Diff: webkit/dom_storage/dom_storage_area.cc

Issue 11088005: Automate more Better Session Restore tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: export inner Created 8 years, 2 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 | « webkit/dom_storage/dom_storage_area.h ('k') | webkit/dom_storage/dom_storage_cached_area.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/dom_storage/dom_storage_area.cc
diff --git a/webkit/dom_storage/dom_storage_area.cc b/webkit/dom_storage/dom_storage_area.cc
index 734edffa0ef2bec4e82551477e90908bffd1ade6..e9afa125fc411a34102fd8bd1ef1779501c69dc9 100644
--- a/webkit/dom_storage/dom_storage_area.cc
+++ b/webkit/dom_storage/dom_storage_area.cc
@@ -24,7 +24,8 @@ using webkit_database::DatabaseUtil;
namespace dom_storage {
-static const int kCommitTimerSeconds = 1;
+// Non-const for testing.
+static int commit_timer_seconds = 1;
DomStorageArea::CommitBatch::CommitBatch()
: clear_all_first(false) {
@@ -250,6 +251,11 @@ void DomStorageArea::Shutdown() {
DCHECK(success);
}
+// static
+void DomStorageArea::DisableCommitDelayForTesting() {
+ commit_timer_seconds = 0;
+}
+
void DomStorageArea::InitialImportIfNeeded() {
if (is_initial_import_done_)
return;
@@ -274,7 +280,7 @@ DomStorageArea::CommitBatch* DomStorageArea::CreateCommitBatchIfNeeded() {
task_runner_->PostDelayedTask(
FROM_HERE,
base::Bind(&DomStorageArea::OnCommitTimer, this),
- base::TimeDelta::FromSeconds(kCommitTimerSeconds));
+ base::TimeDelta::FromSeconds(commit_timer_seconds));
}
}
return commit_batch_.get();
@@ -325,7 +331,7 @@ void DomStorageArea::OnCommitComplete() {
task_runner_->PostDelayedTask(
FROM_HERE,
base::Bind(&DomStorageArea::OnCommitTimer, this),
- base::TimeDelta::FromSeconds(kCommitTimerSeconds));
+ base::TimeDelta::FromSeconds(commit_timer_seconds));
}
}
« no previous file with comments | « webkit/dom_storage/dom_storage_area.h ('k') | webkit/dom_storage/dom_storage_cached_area.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698