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

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

Issue 2861473002: Clear up session only storage on localstorage shutdown (Closed)
Patch Set: address comments Created 3 years, 7 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/dom_storage/dom_storage_context_wrapper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/dom_storage/dom_storage_browsertest.cc
diff --git a/content/browser/dom_storage/dom_storage_browsertest.cc b/content/browser/dom_storage/dom_storage_browsertest.cc
index 8c4b74502697de74a685be09ca0bf7cf4e820199..238a69de3d7af45c4f5dce3449c3bb08614c77a6 100644
--- a/content/browser/dom_storage/dom_storage_browsertest.cc
+++ b/content/browser/dom_storage/dom_storage_browsertest.cc
@@ -54,23 +54,21 @@ class MojoDOMStorageBrowserTest : public DOMStorageBrowserTest {
BrowserContext::GetDefaultStoragePartition(
shell()->web_contents()->GetBrowserContext())
->GetDOMStorageContext())
- ->mojo_state_.get();
+ ->mojo_state_;
}
void EnsureConnected() {
base::RunLoop run_loop;
- context()->RunWhenConnected(run_loop.QuitClosure());
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ base::BindOnce(
+ &LocalStorageContextMojo::RunWhenConnected,
+ base::Unretained(context()),
+ base::BindOnce(base::IgnoreResult(&base::TaskRunner::PostTask),
+ base::ThreadTaskRunnerHandle::Get(), FROM_HERE,
+ run_loop.QuitClosure())));
run_loop.Run();
}
-
- void Flush() {
- // Process any tasks that are currently queued, to ensure
- // LevelDBWrapperImpl methods get called.
- base::RunLoop().RunUntilIdle();
- // And finally flush all the now queued up changes to leveldb.
- context()->Flush();
- base::RunLoop().RunUntilIdle();
- }
};
static const bool kIncognito = true;
@@ -109,7 +107,6 @@ IN_PROC_BROWSER_TEST_F(MojoDOMStorageBrowserTest, SanityCheckIncognito) {
IN_PROC_BROWSER_TEST_F(MojoDOMStorageBrowserTest, PRE_DataPersists) {
EnsureConnected();
SimpleTest(GetTestUrl("dom_storage", "store_data.html"), kNotIncognito);
- Flush();
}
IN_PROC_BROWSER_TEST_F(MojoDOMStorageBrowserTest, MAYBE_DataPersists) {
« no previous file with comments | « no previous file | content/browser/dom_storage/dom_storage_context_wrapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698