| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
| 8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 namespace util = settings_test_util; | 38 namespace util = settings_test_util; |
| 39 | 39 |
| 40 namespace { | 40 namespace { |
| 41 | 41 |
| 42 // To save typing ValueStore::DEFAULTS everywhere. | 42 // To save typing ValueStore::DEFAULTS everywhere. |
| 43 const ValueStore::WriteOptions DEFAULTS = ValueStore::DEFAULTS; | 43 const ValueStore::WriteOptions DEFAULTS = ValueStore::DEFAULTS; |
| 44 | 44 |
| 45 // Gets the pretty-printed JSON for a value. | 45 // Gets the pretty-printed JSON for a value. |
| 46 static std::string GetJson(const base::Value& value) { | 46 static std::string GetJson(const base::Value& value) { |
| 47 std::string json; | 47 std::string json; |
| 48 base::JSONWriter::WriteWithOptions(&value, | 48 base::JSONWriter::WriteWithOptions( |
| 49 base::JSONWriter::OPTIONS_PRETTY_PRINT, | 49 value, base::JSONWriter::OPTIONS_PRETTY_PRINT, &json); |
| 50 &json); | |
| 51 return json; | 50 return json; |
| 52 } | 51 } |
| 53 | 52 |
| 54 // Returns whether two Values are equal. | 53 // Returns whether two Values are equal. |
| 55 testing::AssertionResult ValuesEq( | 54 testing::AssertionResult ValuesEq( |
| 56 const char* _1, const char* _2, | 55 const char* _1, const char* _2, |
| 57 const base::Value* expected, | 56 const base::Value* expected, |
| 58 const base::Value* actual) { | 57 const base::Value* actual) { |
| 59 if (expected == actual) { | 58 if (expected == actual) { |
| 60 return testing::AssertionSuccess(); | 59 return testing::AssertionSuccess(); |
| (...skipping 1440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1501 settings_namespace::SYNC, | 1500 settings_namespace::SYNC, |
| 1502 base::Bind(&UnlimitedSyncStorageTestCallback)); | 1501 base::Bind(&UnlimitedSyncStorageTestCallback)); |
| 1503 frontend_->RunWithStorage(extension, | 1502 frontend_->RunWithStorage(extension, |
| 1504 settings_namespace::LOCAL, | 1503 settings_namespace::LOCAL, |
| 1505 base::Bind(&UnlimitedLocalStorageTestCallback)); | 1504 base::Bind(&UnlimitedLocalStorageTestCallback)); |
| 1506 | 1505 |
| 1507 base::MessageLoop::current()->RunUntilIdle(); | 1506 base::MessageLoop::current()->RunUntilIdle(); |
| 1508 } | 1507 } |
| 1509 | 1508 |
| 1510 } // namespace extensions | 1509 } // namespace extensions |
| OLD | NEW |