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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 id, Extension::TYPE_PACKAGED_APP); | 143 id, Extension::TYPE_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 an ExtensionDataDeleter. | 153 // This would be triggered by extension uninstall via a DataDeleter. |
154 frontend_->DeleteStorageSoon(id); | 154 frontend_->DeleteStorageSoon(id); |
155 MessageLoop::current()->RunAllPending(); | 155 MessageLoop::current()->RunAllPending(); |
156 | 156 |
157 // The storage area may no longer be valid post-uninstall, so re-request. | 157 // The storage area may no longer be valid post-uninstall, so re-request. |
158 storage = util::GetStorage(id, frontend_.get()); | 158 storage = util::GetStorage(id, frontend_.get()); |
159 { | 159 { |
160 ValueStore::ReadResult result = storage->Get(); | 160 ValueStore::ReadResult result = storage->Get(); |
161 ASSERT_FALSE(result->HasError()); | 161 ASSERT_FALSE(result->HasError()); |
162 EXPECT_TRUE(result->settings()->empty()); | 162 EXPECT_TRUE(result->settings()->empty()); |
163 } | 163 } |
(...skipping 149 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 |