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

Side by Side Diff: content/browser/media/webrtc_identity_store_unittest.cc

Issue 1496493004: Revert of Tests: Simplify SequencedWorkerPoolOwner, call Shutdown on destructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/bind.h" 5 #include "base/bind.h"
6 #include "base/files/scoped_temp_dir.h" 6 #include "base/files/scoped_temp_dir.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/test/sequenced_worker_pool_owner.h" 8 #include "base/test/sequenced_worker_pool_owner.h"
9 #include "content/browser/media/webrtc_identity_store.h" 9 #include "content/browser/media/webrtc_identity_store.h"
10 #include "content/public/test/test_browser_thread_bundle.h" 10 #include "content/public/test/test_browser_thread_bundle.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 WebRtcIdentityStoreTest() 42 WebRtcIdentityStoreTest()
43 : browser_thread_bundle_(TestBrowserThreadBundle::IO_MAINLOOP | 43 : browser_thread_bundle_(TestBrowserThreadBundle::IO_MAINLOOP |
44 TestBrowserThreadBundle::REAL_DB_THREAD), 44 TestBrowserThreadBundle::REAL_DB_THREAD),
45 pool_owner_( 45 pool_owner_(
46 new base::SequencedWorkerPoolOwner(3, "WebRtcIdentityStoreTest")), 46 new base::SequencedWorkerPoolOwner(3, "WebRtcIdentityStoreTest")),
47 webrtc_identity_store_( 47 webrtc_identity_store_(
48 new WebRTCIdentityStore(base::FilePath(), NULL)) { 48 new WebRTCIdentityStore(base::FilePath(), NULL)) {
49 webrtc_identity_store_->SetTaskRunnerForTesting(pool_owner_->pool()); 49 webrtc_identity_store_->SetTaskRunnerForTesting(pool_owner_->pool());
50 } 50 }
51 51
52 ~WebRtcIdentityStoreTest() override { pool_owner_->pool()->Shutdown(); }
53
52 void SetValidityPeriod(base::TimeDelta validity_period) { 54 void SetValidityPeriod(base::TimeDelta validity_period) {
53 webrtc_identity_store_->SetValidityPeriodForTesting(validity_period); 55 webrtc_identity_store_->SetValidityPeriodForTesting(validity_period);
54 } 56 }
55 57
56 void RunUntilIdle() { 58 void RunUntilIdle() {
57 RunAllPendingInMessageLoop(BrowserThread::DB); 59 RunAllPendingInMessageLoop(BrowserThread::DB);
58 RunAllPendingInMessageLoop(BrowserThread::IO); 60 RunAllPendingInMessageLoop(BrowserThread::IO);
59 pool_owner_->pool()->FlushForTesting(); 61 pool_owner_->pool()->FlushForTesting();
60 base::RunLoop().RunUntilIdle(); 62 base::RunLoop().RunUntilIdle();
61 } 63 }
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 387
386 // Verifies the corrupted table was razed. 388 // Verifies the corrupted table was razed.
387 scoped_ptr<sql::Connection> db(new sql::Connection()); 389 scoped_ptr<sql::Connection> db(new sql::Connection());
388 EXPECT_TRUE(db->Open(db_path)); 390 EXPECT_TRUE(db->Open(db_path));
389 EXPECT_EQ(0U, sql::test::CountSQLTables(db.get())); 391 EXPECT_EQ(0U, sql::test::CountSQLTables(db.get()));
390 392
391 Stop(); 393 Stop();
392 } 394 }
393 395
394 } // namespace content 396 } // namespace content
OLDNEW
« no previous file with comments | « components/update_client/update_client_unittest.cc ('k') | content/browser/net/quota_policy_cookie_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698