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

Issue 308103004: IndexedDB: Using a mock IndexedDBFactory for unit tests (Closed)

Created:
6 years, 6 months ago by cmumford
Modified:
6 years, 4 months ago
Reviewers:
jsbell
CC:
chromium-reviews, jam, alecflett, ericu+idb_chromium.org, darin-cc_chromium.org, cmumford, dgrogan, jsbell+idb_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

IndexedDB: IndexedDBDatabase now always requires a factory Created a new MockIndexedDBFactory for use by unit tests. This obviates the need to instantiate a real factory (AKA IndexedDBFactoryImpl) in unit tests. This in turn allows IndexedDBDatabase to be modified to always require an IndexedDBFactory and removes different paths for test & non-test uses. Several existing unit tests have been modified to use the new MockIndexedDBFactory. BUG=393974 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=286644

Patch Set 1 #

Patch Set 2 : Tests now create their own IndexedDBFactory #

Patch Set 3 : Added MockIndexedDBFactory #

Patch Set 4 : Forgot to add mock_indexed_db_factory.* files in last patch set. #

Patch Set 5 : Using MockIndexedDBFactory in indexed_db_database_unittest.cc #

Patch Set 6 : Removed uneeded indexed_db_factory.h #

Patch Set 7 : Minor cleanup to resync with ToT #

Total comments: 4

Patch Set 8 : MockIDBFactory -> RegistryTestMockFactory & OriginDBs #

Patch Set 9 : Don't use GoogleMock with std::pair types #

Unified diffs Side-by-side diffs Delta from patch set Stats (+145 lines, -39 lines) Patch
M content/browser/indexed_db/indexed_db_active_blob_registry_unittest.cc View 1 2 3 4 5 6 7 4 chunks +10 lines, -10 lines 0 comments Download
M content/browser/indexed_db/indexed_db_database.cc View 1 2 3 4 5 6 4 chunks +3 lines, -11 lines 0 comments Download
M content/browser/indexed_db/indexed_db_database_unittest.cc View 1 2 3 4 5 6 7 chunks +10 lines, -7 lines 0 comments Download
M content/browser/indexed_db/indexed_db_factory.h View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/indexed_db/indexed_db_factory_impl.h View 1 2 3 4 5 6 7 2 chunks +6 lines, -2 lines 0 comments Download
M content/browser/indexed_db/indexed_db_factory_impl.cc View 1 2 3 4 5 6 7 3 chunks +3 lines, -4 lines 0 comments Download
M content/browser/indexed_db/indexed_db_transaction_unittest.cc View 1 2 3 4 5 6 4 chunks +4 lines, -3 lines 0 comments Download
A content/browser/indexed_db/mock_indexed_db_factory.h View 1 2 3 4 5 6 7 8 1 chunk +85 lines, -0 lines 0 comments Download
A content/browser/indexed_db/mock_indexed_db_factory.cc View 1 2 3 4 5 6 7 8 1 chunk +20 lines, -0 lines 0 comments Download
M content/content_tests.gypi View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
cmumford
6 years, 4 months ago (2014-07-28 22:05:37 UTC) #1
jsbell
lgtm https://codereview.chromium.org/308103004/diff/120001/content/browser/indexed_db/indexed_db_active_blob_registry_unittest.cc File content/browser/indexed_db/indexed_db_active_blob_registry_unittest.cc (right): https://codereview.chromium.org/308103004/diff/120001/content/browser/indexed_db/indexed_db_active_blob_registry_unittest.cc#newcode18 content/browser/indexed_db/indexed_db_active_blob_registry_unittest.cc:18: class MockIDBFactory : public MockIndexedDBFactory { Can we ...
6 years, 4 months ago (2014-07-28 22:26:16 UTC) #2
cmumford
https://codereview.chromium.org/308103004/diff/120001/content/browser/indexed_db/indexed_db_active_blob_registry_unittest.cc File content/browser/indexed_db/indexed_db_active_blob_registry_unittest.cc (right): https://codereview.chromium.org/308103004/diff/120001/content/browser/indexed_db/indexed_db_active_blob_registry_unittest.cc#newcode18 content/browser/indexed_db/indexed_db_active_blob_registry_unittest.cc:18: class MockIDBFactory : public MockIndexedDBFactory { On 2014/07/28 22:26:15, ...
6 years, 4 months ago (2014-07-28 22:46:35 UTC) #3
cmumford
The CQ bit was checked by cmumford@chromium.org
6 years, 4 months ago (2014-07-29 15:13:36 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/cmumford@chromium.org/308103004/140001
6 years, 4 months ago (2014-07-29 15:15:23 UTC) #5
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_clang_dbg on tryserver.chromium.linux ...
6 years, 4 months ago (2014-07-29 18:10:08 UTC) #6
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 4 months ago (2014-07-29 20:20:50 UTC) #7
commit-bot: I haz the power
Try jobs failed on following builders: android_clang_dbg on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/android_clang_dbg/builds/967)
6 years, 4 months ago (2014-07-29 20:20:50 UTC) #8
cmumford
The CQ bit was checked by cmumford@chromium.org
6 years, 4 months ago (2014-07-30 17:27:06 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/cmumford@chromium.org/308103004/160001
6 years, 4 months ago (2014-07-30 17:28:28 UTC) #10
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: mac_chromium_rel on tryserver.chromium.mac ...
6 years, 4 months ago (2014-07-30 21:01:59 UTC) #11
commit-bot: I haz the power
6 years, 4 months ago (2014-07-31 00:04:04 UTC) #12
Message was sent while issue was closed.
Change committed as 286644

Powered by Google App Engine
This is Rietveld 408576698