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

Side by Side Diff: content/browser/indexed_db/indexed_db_backing_store_unittest.cc

Issue 448953003: Fix IndexedDB tests to use a TestBrowserThreadBundle (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "content/browser/indexed_db/indexed_db_backing_store.h" 5 #include "content/browser/indexed_db/indexed_db_backing_store.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/files/scoped_temp_dir.h" 9 #include "base/files/scoped_temp_dir.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 if (backing_store_->removals().size() != backing_store_->writes().size()) 322 if (backing_store_->removals().size() != backing_store_->writes().size())
323 return false; 323 return false;
324 for (size_t i = 0; i < backing_store_->writes().size(); ++i) { 324 for (size_t i = 0; i < backing_store_->writes().size(); ++i) {
325 if (backing_store_->writes()[i].key() != backing_store_->removals()[i]) 325 if (backing_store_->writes()[i].key() != backing_store_->removals()[i])
326 return false; 326 return false;
327 } 327 }
328 return true; 328 return true;
329 } 329 }
330 330
331 protected: 331 protected:
332 content::TestBrowserThreadBundle thread_bundle_;
cmumford 2014/08/07 15:15:27 Is it worth a comment that this must precede url_r
333
332 base::ScopedTempDir temp_dir_; 334 base::ScopedTempDir temp_dir_;
333 scoped_refptr<base::TestSimpleTaskRunner> task_runner_; 335 scoped_refptr<base::TestSimpleTaskRunner> task_runner_;
334 scoped_refptr<MockSpecialStoragePolicy> special_storage_policy_; 336 scoped_refptr<MockSpecialStoragePolicy> special_storage_policy_;
335 scoped_refptr<IndexedDBContextImpl> idb_context_; 337 scoped_refptr<IndexedDBContextImpl> idb_context_;
336 scoped_refptr<TestIDBFactory> idb_factory_; 338 scoped_refptr<TestIDBFactory> idb_factory_;
337 net::TestURLRequestContext url_request_context_; 339 net::TestURLRequestContext url_request_context_;
338 340
339 scoped_refptr<TestableIndexedDBBackingStore> backing_store_; 341 scoped_refptr<TestableIndexedDBBackingStore> backing_store_;
340 342
341 // Sample keys and values that are consistent. 343 // Sample keys and values that are consistent.
342 IndexedDBKey m_key1; 344 IndexedDBKey m_key1;
343 IndexedDBKey m_key2; 345 IndexedDBKey m_key2;
344 IndexedDBKey m_key3; 346 IndexedDBKey m_key3;
345 IndexedDBValue m_value1; 347 IndexedDBValue m_value1;
346 IndexedDBValue m_value2; 348 IndexedDBValue m_value2;
347 IndexedDBValue m_value3; 349 IndexedDBValue m_value3;
348 std::vector<IndexedDBBlobInfo> m_blob_info; 350 std::vector<IndexedDBBlobInfo> m_blob_info;
349 351
350 private: 352 private:
351 content::TestBrowserThreadBundle thread_bundle_;
352
353 DISALLOW_COPY_AND_ASSIGN(IndexedDBBackingStoreTest); 353 DISALLOW_COPY_AND_ASSIGN(IndexedDBBackingStoreTest);
354 }; 354 };
355 355
356 class TestCallback : public IndexedDBBackingStore::BlobWriteCallback { 356 class TestCallback : public IndexedDBBackingStore::BlobWriteCallback {
357 public: 357 public:
358 TestCallback() : called(false), succeeded(false) {} 358 TestCallback() : called(false), succeeded(false) {}
359 virtual void Run(bool succeeded_in) OVERRIDE { 359 virtual void Run(bool succeeded_in) OVERRIDE {
360 called = true; 360 called = true;
361 succeeded = succeeded_in; 361 succeeded = succeeded_in;
362 } 362 }
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 EXPECT_EQ(index_name, index.name); 966 EXPECT_EQ(index_name, index.name);
967 EXPECT_EQ(index_key_path, index.key_path); 967 EXPECT_EQ(index_key_path, index.key_path);
968 EXPECT_EQ(unique, index.unique); 968 EXPECT_EQ(unique, index.unique);
969 EXPECT_EQ(multi_entry, index.multi_entry); 969 EXPECT_EQ(multi_entry, index.multi_entry);
970 } 970 }
971 } 971 }
972 972
973 } // namespace 973 } // namespace
974 974
975 } // namespace content 975 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698