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

Unified Diff: content/browser/dom_storage/local_storage_context_mojo_unittest.cc

Issue 2597353002: Add callback to LevelDBWrapperImpl to allow extra operations on commit. (Closed)
Patch Set: Created 4 years 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 | « content/browser/dom_storage/local_storage_context_mojo.cc ('k') | content/browser/leveldb_wrapper_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/dom_storage/local_storage_context_mojo_unittest.cc
diff --git a/content/browser/dom_storage/local_storage_context_mojo_unittest.cc b/content/browser/dom_storage/local_storage_context_mojo_unittest.cc
index 81f6b5707a4316460a759bf8caf2cecd1b7341a9..0da3bd685ccdf113802fae711815f948c70a3cc7 100644
--- a/content/browser/dom_storage/local_storage_context_mojo_unittest.cc
+++ b/content/browser/dom_storage/local_storage_context_mojo_unittest.cc
@@ -72,6 +72,7 @@ TEST_F(LocalStorageContextMojoTest, Basic) {
wrapper.reset();
base::RunLoop().RunUntilIdle();
+
ASSERT_EQ(2u, mock_data().size());
EXPECT_EQ(value, mock_data().rbegin()->second);
}
@@ -134,4 +135,23 @@ TEST_F(LocalStorageContextMojoTest, InvalidVersion) {
EXPECT_FALSE(success);
}
+TEST_F(LocalStorageContextMojoTest, VersionOnlyWrittenOnCommit) {
+ mojom::LevelDBWrapperPtr wrapper;
+ context()->OpenLocalStorage(url::Origin(GURL("http://foobar.com")),
+ MakeRequest(&wrapper));
+
+ base::RunLoop run_loop;
+ bool success = false;
+ std::vector<uint8_t> result;
+ wrapper->Get(
+ StdStringToUint8Vector("key"),
+ base::Bind(&GetCallback, run_loop.QuitClosure(), &success, &result));
+ run_loop.Run();
+ EXPECT_FALSE(success);
+ wrapper.reset();
+
+ base::RunLoop().RunUntilIdle();
+ EXPECT_TRUE(mock_data().empty());
+}
+
} // namespace content
« no previous file with comments | « content/browser/dom_storage/local_storage_context_mojo.cc ('k') | content/browser/leveldb_wrapper_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698