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

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: nicer api 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
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..3f9301a54e0ef65fd7c85f2460b866177e0f5190 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) {
@@ -274,7 +275,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 +326,7 @@ void DomStorageArea::OnCommitComplete() {
task_runner_->PostDelayedTask(
FROM_HERE,
base::Bind(&DomStorageArea::OnCommitTimer, this),
- base::TimeDelta::FromSeconds(kCommitTimerSeconds));
+ base::TimeDelta::FromSeconds(commit_timer_seconds));
}
}
@@ -345,4 +346,9 @@ void DomStorageArea::ShutdownInCommitSequence() {
session_storage_backing_ = NULL;
}
+// static
+void DomStorageArea::DisableCommitDelayForTesting() {
+ commit_timer_seconds = 0;
+}
+
} // namespace dom_storage

Powered by Google App Engine
This is Rietveld 408576698