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

Side by Side Diff: content/browser/leveldb_wrapper_impl_unittest.cc

Issue 2604963002: Store per-origin metadata for localstorage. (Closed)
Patch Set: remove duplicate include line Created 3 years, 11 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
« no previous file with comments | « content/browser/leveldb_wrapper_impl.cc ('k') | content/test/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/leveldb_wrapper_impl.h" 5 #include "content/browser/leveldb_wrapper_impl.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "components/leveldb/public/cpp/util.h" 9 #include "components/leveldb/public/cpp/util.h"
10 #include "content/public/test/test_browser_thread_bundle.h" 10 #include "content/public/test/test_browser_thread_bundle.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 void Complete(bool success) override { 46 void Complete(bool success) override {
47 *m_result = success; 47 *m_result = success;
48 m_callback.Run(); 48 m_callback.Run();
49 } 49 }
50 50
51 bool* m_result; 51 bool* m_result;
52 base::Closure m_callback; 52 base::Closure m_callback;
53 }; 53 };
54 54
55 void NoOp() {} 55 void NoOp() {}
56 std::vector<leveldb::mojom::BatchedOperationPtr> PrepareToCommitNoOp() { 56 std::vector<leveldb::mojom::BatchedOperationPtr> PrepareToCommitNoOp(
57 const LevelDBWrapperImpl&) {
57 return std::vector<leveldb::mojom::BatchedOperationPtr>(); 58 return std::vector<leveldb::mojom::BatchedOperationPtr>();
58 } 59 }
59 60
60 void GetCallback(const base::Closure& callback, 61 void GetCallback(const base::Closure& callback,
61 bool* success_out, 62 bool* success_out,
62 std::vector<uint8_t>* value_out, 63 std::vector<uint8_t>* value_out,
63 bool success, 64 bool success,
64 const std::vector<uint8_t>& value) { 65 const std::vector<uint8_t>& value) {
65 *success_out = success; 66 *success_out = success;
66 *value_out = value; 67 *value_out = value;
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 // Reducing size should also succeed. 425 // Reducing size should also succeed.
425 value.clear(); 426 value.clear();
426 EXPECT_TRUE(PutSync(key, value)); 427 EXPECT_TRUE(PutSync(key, value));
427 428
428 // Increasing size should fail. 429 // Increasing size should fail.
429 value.resize(1, 'a'); 430 value.resize(1, 'a');
430 EXPECT_FALSE(PutSync(key, value)); 431 EXPECT_FALSE(PutSync(key, value));
431 } 432 }
432 433
433 } // namespace content 434 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/leveldb_wrapper_impl.cc ('k') | content/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698