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

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

Issue 2472213003: [IndexedDB] Refactoring to remove ref ptrs and host transaction ids. (Closed)
Patch Set: rebase Created 4 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 (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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 IndexedDBValue m_value3; 368 IndexedDBValue m_value3;
369 std::vector<IndexedDBBlobInfo> m_blob_info; 369 std::vector<IndexedDBBlobInfo> m_blob_info;
370 370
371 private: 371 private:
372 DISALLOW_COPY_AND_ASSIGN(IndexedDBBackingStoreTest); 372 DISALLOW_COPY_AND_ASSIGN(IndexedDBBackingStoreTest);
373 }; 373 };
374 374
375 class TestCallback : public IndexedDBBackingStore::BlobWriteCallback { 375 class TestCallback : public IndexedDBBackingStore::BlobWriteCallback {
376 public: 376 public:
377 TestCallback() : called(false), succeeded(false) {} 377 TestCallback() : called(false), succeeded(false) {}
378 void Run(bool succeeded_in) override { 378 leveldb::Status Run(IndexedDBBackingStore::BlobWriteResult result) override {
379 called = true; 379 called = true;
380 succeeded = succeeded_in; 380 switch(result) {
cmumford 2016/12/01 19:14:51 Add space before (
dmurph 2016/12/01 21:12:23 Done.
381 case IndexedDBBackingStore::BlobWriteResult::FAIILURE_ASYNC:
382 succeeded = false;
383 break;
384 case IndexedDBBackingStore::BlobWriteResult::SUCCESS_ASYNC:
cmumford 2016/12/01 19:14:51 Nit: Could replace the switch with: succeeded =
dmurph 2016/12/01 21:12:23 I'd rather have the switch statement so that it fa
385 case IndexedDBBackingStore::BlobWriteResult::SUCCESS_SYNC:
386 succeeded = true;
387 break;
388 }
389 return leveldb::Status::OK();
381 } 390 }
382 bool called; 391 bool called;
383 bool succeeded; 392 bool succeeded;
384 393
385 protected: 394 protected:
386 ~TestCallback() override {} 395 ~TestCallback() override {}
387 396
388 private: 397 private:
389 DISALLOW_COPY_AND_ASSIGN(TestCallback); 398 DISALLOW_COPY_AND_ASSIGN(TestCallback);
390 }; 399 };
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
1149 1158
1150 // Dictionary, message key and more. 1159 // Dictionary, message key and more.
1151 ASSERT_TRUE(WriteFile(info_path, "{\"message\":\"foo\",\"bar\":5}")); 1160 ASSERT_TRUE(WriteFile(info_path, "{\"message\":\"foo\",\"bar\":5}"));
1152 EXPECT_TRUE( 1161 EXPECT_TRUE(
1153 IndexedDBBackingStore::ReadCorruptionInfo(path_base, origin, &message)); 1162 IndexedDBBackingStore::ReadCorruptionInfo(path_base, origin, &message));
1154 EXPECT_FALSE(PathExists(info_path)); 1163 EXPECT_FALSE(PathExists(info_path));
1155 EXPECT_EQ("foo", message); 1164 EXPECT_EQ("foo", message);
1156 } 1165 }
1157 1166
1158 } // namespace content 1167 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698