| 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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 { | 133 { |
| 134 ValueStore::ReadResult result = storage->Get(); | 134 ValueStore::ReadResult result = storage->Get(); |
| 135 ASSERT_FALSE(result->HasError()); | 135 ASSERT_FALSE(result->HasError()); |
| 136 EXPECT_FALSE(result->settings()->empty()); | 136 EXPECT_FALSE(result->settings()->empty()); |
| 137 } | 137 } |
| 138 } | 138 } |
| 139 | 139 |
| 140 TEST_F(ExtensionSettingsFrontendTest, SettingsClearedOnUninstall) { | 140 TEST_F(ExtensionSettingsFrontendTest, SettingsClearedOnUninstall) { |
| 141 const std::string id = "ext"; | 141 const std::string id = "ext"; |
| 142 profile_->GetMockExtensionService()->AddExtensionWithId( | 142 profile_->GetMockExtensionService()->AddExtensionWithId( |
| 143 id, Extension::TYPE_PACKAGED_APP); | 143 id, Extension::TYPE_LEGACY_PACKAGED_APP); |
| 144 | 144 |
| 145 ValueStore* storage = util::GetStorage(id, frontend_.get()); | 145 ValueStore* storage = util::GetStorage(id, frontend_.get()); |
| 146 | 146 |
| 147 { | 147 { |
| 148 StringValue bar("bar"); | 148 StringValue bar("bar"); |
| 149 ValueStore::WriteResult result = storage->Set(DEFAULTS, "foo", bar); | 149 ValueStore::WriteResult result = storage->Set(DEFAULTS, "foo", bar); |
| 150 ASSERT_FALSE(result->HasError()); | 150 ASSERT_FALSE(result->HasError()); |
| 151 } | 151 } |
| 152 | 152 |
| 153 // This would be triggered by extension uninstall via a DataDeleter. | 153 // This would be triggered by extension uninstall via a DataDeleter. |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 | 313 |
| 314 frontend_->RunWithStorage( | 314 frontend_->RunWithStorage( |
| 315 id, settings::SYNC, base::Bind(&UnlimitedSyncStorageTestCallback)); | 315 id, settings::SYNC, base::Bind(&UnlimitedSyncStorageTestCallback)); |
| 316 frontend_->RunWithStorage( | 316 frontend_->RunWithStorage( |
| 317 id, settings::LOCAL, base::Bind(&UnlimitedLocalStorageTestCallback)); | 317 id, settings::LOCAL, base::Bind(&UnlimitedLocalStorageTestCallback)); |
| 318 | 318 |
| 319 MessageLoop::current()->RunAllPending(); | 319 MessageLoop::current()->RunAllPending(); |
| 320 } | 320 } |
| 321 | 321 |
| 322 } // namespace extensions | 322 } // namespace extensions |
| OLD | NEW |