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 "content/renderer/dom_storage/dom_storage_cached_area.h" | 5 #include "content/renderer/dom_storage/dom_storage_cached_area.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 virtual ~MockProxy() {} | 113 virtual ~MockProxy() {} |
114 }; | 114 }; |
115 | 115 |
116 } // namespace | 116 } // namespace |
117 | 117 |
118 class DOMStorageCachedAreaTest : public testing::Test { | 118 class DOMStorageCachedAreaTest : public testing::Test { |
119 public: | 119 public: |
120 DOMStorageCachedAreaTest() | 120 DOMStorageCachedAreaTest() |
121 : kNamespaceId(10), | 121 : kNamespaceId(10), |
122 kOrigin("http://dom_storage/"), | 122 kOrigin("http://dom_storage/"), |
123 kKey(ASCIIToUTF16("key")), | 123 kKey(base::ASCIIToUTF16("key")), |
124 kValue(ASCIIToUTF16("value")), | 124 kValue(base::ASCIIToUTF16("value")), |
125 kPageUrl("http://dom_storage/page") { | 125 kPageUrl("http://dom_storage/page") { |
126 } | 126 } |
127 | 127 |
128 const int64 kNamespaceId; | 128 const int64 kNamespaceId; |
129 const GURL kOrigin; | 129 const GURL kOrigin; |
130 const base::string16 kKey; | 130 const base::string16 kKey; |
131 const base::string16 kValue; | 131 const base::string16 kValue; |
132 const GURL kPageUrl; | 132 const GURL kPageUrl; |
133 | 133 |
134 virtual void SetUp() { | 134 virtual void SetUp() { |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 EXPECT_FALSE(IsIgnoringKeyMutations(cached_area.get(), kKey)); | 354 EXPECT_FALSE(IsIgnoringKeyMutations(cached_area.get(), kKey)); |
355 | 355 |
356 // A failed set item operation should Reset the cache. | 356 // A failed set item operation should Reset the cache. |
357 EXPECT_TRUE(cached_area->SetItem(kConnectionId, kKey, kValue, kPageUrl)); | 357 EXPECT_TRUE(cached_area->SetItem(kConnectionId, kKey, kValue, kPageUrl)); |
358 EXPECT_TRUE(IsIgnoringKeyMutations(cached_area.get(), kKey)); | 358 EXPECT_TRUE(IsIgnoringKeyMutations(cached_area.get(), kKey)); |
359 mock_proxy_->CompleteOnePendingCallback(false); | 359 mock_proxy_->CompleteOnePendingCallback(false); |
360 EXPECT_FALSE(IsPrimed(cached_area.get())); | 360 EXPECT_FALSE(IsPrimed(cached_area.get())); |
361 } | 361 } |
362 | 362 |
363 } // namespace content | 363 } // namespace content |
OLD | NEW |