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

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

Issue 2861473002: Clear up session only storage on localstorage shutdown (Closed)
Patch Set: test and nicer Created 3 years, 8 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: 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 3a109c96ba8d2cb8eb5175f6c80b3679db3d8924..dba68cc260273f5227f18439ec3ced8179f7787d 100644
--- a/content/browser/dom_storage/dom_storage_browsertest.cc
+++ b/content/browser/dom_storage/dom_storage_browsertest.cc
@@ -59,7 +59,13 @@ class MojoDOMStorageBrowserTest : public DOMStorageBrowserTest {
void EnsureConnected() {
base::RunLoop run_loop;
- context()->RunWhenConnected(run_loop.QuitClosure());
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ base::BindOnce(
+ &LocalStorageContextMojo::RunWhenConnected, context(),
+ base::BindOnce(base::IgnoreResult(&base::TaskRunner::PostTask),
+ base::ThreadTaskRunnerHandle::Get(), FROM_HERE,
+ run_loop.QuitClosure())));
run_loop.Run();
}
@@ -68,7 +74,9 @@ class MojoDOMStorageBrowserTest : public DOMStorageBrowserTest {
// LevelDBWrapperImpl methods get called.
base::RunLoop().RunUntilIdle();
// And finally flush all the now queued up changes to leveldb.
- context()->Flush();
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ base::BindOnce(&LocalStorageContextMojo::Flush, context()));
base::RunLoop().RunUntilIdle();
michaeln 2017/05/03 21:01:29 I'm not sure what the RunUntilIdle() here accompli
Marijn Kruisselbrink 2017/05/04 23:03:46 Hmm, yeah, good point... probably all of this flus
}
};

Powered by Google App Engine
This is Rietveld 408576698