| 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/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 scoped_ptr<Value> megabyte = CreateMegabyte(); | 253 scoped_ptr<Value> megabyte = CreateMegabyte(); |
| 254 for (int i = 0; i < 7; ++i) { | 254 for (int i = 0; i < 7; ++i) { |
| 255 local_storage->Set( | 255 local_storage->Set( |
| 256 ValueStore::DEFAULTS, base::StringPrintf("%d", i), *megabyte); | 256 ValueStore::DEFAULTS, base::StringPrintf("%d", i), *megabyte); |
| 257 } | 257 } |
| 258 | 258 |
| 259 EXPECT_FALSE(local_storage->Set( | 259 EXPECT_FALSE(local_storage->Set( |
| 260 ValueStore::DEFAULTS, "WontError", *megabyte)->HasError()); | 260 ValueStore::DEFAULTS, "WontError", *megabyte)->HasError()); |
| 261 } | 261 } |
| 262 | 262 |
| 263 #if defined(OS_WIN) |
| 264 // See: http://crbug.com/227296 |
| 265 #define MAYBE_UnlimitedStorageForLocalButNotSync \ |
| 266 DISABLED_UnlimitedStorageForLocalButNotSync |
| 267 #else |
| 268 #define MAYBE_UnlimitedStorageForLocalButNotSync \ |
| 269 UnlimitedStorageForLocalButNotSync |
| 270 #endif |
| 271 |
| 263 TEST_F(ExtensionSettingsFrontendTest, | 272 TEST_F(ExtensionSettingsFrontendTest, |
| 264 UnlimitedStorageForLocalButNotSync) { | 273 MAYBE_UnlimitedStorageForLocalButNotSync) { |
| 265 const std::string id = "ext"; | 274 const std::string id = "ext"; |
| 266 std::set<std::string> permissions; | 275 std::set<std::string> permissions; |
| 267 permissions.insert("unlimitedStorage"); | 276 permissions.insert("unlimitedStorage"); |
| 268 ExtensionServiceInterface* esi = | 277 ExtensionServiceInterface* esi = |
| 269 extensions::ExtensionSystem::Get(profile_.get())->extension_service(); | 278 extensions::ExtensionSystem::Get(profile_.get())->extension_service(); |
| 270 static_cast<extensions::settings_test_util::MockExtensionService*>(esi)-> | 279 static_cast<extensions::settings_test_util::MockExtensionService*>(esi)-> |
| 271 AddExtensionWithIdAndPermissions(id, Manifest::TYPE_EXTENSION, | 280 AddExtensionWithIdAndPermissions(id, Manifest::TYPE_EXTENSION, |
| 272 permissions); | 281 permissions); |
| 273 | 282 |
| 274 frontend_->RunWithStorage( | 283 frontend_->RunWithStorage( |
| 275 id, settings::SYNC, base::Bind(&UnlimitedSyncStorageTestCallback)); | 284 id, settings::SYNC, base::Bind(&UnlimitedSyncStorageTestCallback)); |
| 276 frontend_->RunWithStorage( | 285 frontend_->RunWithStorage( |
| 277 id, settings::LOCAL, base::Bind(&UnlimitedLocalStorageTestCallback)); | 286 id, settings::LOCAL, base::Bind(&UnlimitedLocalStorageTestCallback)); |
| 278 | 287 |
| 279 MessageLoop::current()->RunUntilIdle(); | 288 MessageLoop::current()->RunUntilIdle(); |
| 280 } | 289 } |
| 281 | 290 |
| 282 } // namespace extensions | 291 } // namespace extensions |
| OLD | NEW |