Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: content/common/dom_storage/dom_storage_map_unittest.cc

Issue 113403006: Update some uses of char16 to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/strings/utf_string_conversions.h" 5 #include "base/strings/utf_string_conversions.h"
6 #include "content/common/dom_storage/dom_storage_map.h" 6 #include "content/common/dom_storage/dom_storage_map.h"
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 using base::ASCIIToUTF16; 9 using base::ASCIIToUTF16;
10 10
11 namespace content { 11 namespace content {
12 12
13 TEST(DOMStorageMapTest, DOMStorageMapBasics) { 13 TEST(DOMStorageMapTest, DOMStorageMapBasics) {
14 const base::string16 kKey(ASCIIToUTF16("key")); 14 const base::string16 kKey(ASCIIToUTF16("key"));
15 const base::string16 kValue(ASCIIToUTF16("value")); 15 const base::string16 kValue(ASCIIToUTF16("value"));
16 const size_t kValueBytes = kValue.size() * sizeof(char16); 16 const size_t kValueBytes = kValue.size() * sizeof(base::char16);
17 const size_t kItemBytes = 17 const size_t kItemBytes =
18 (kKey.size() + kValue.size()) * sizeof(char16); 18 (kKey.size() + kValue.size()) * sizeof(base::char16);
19 const base::string16 kKey2(ASCIIToUTF16("key2")); 19 const base::string16 kKey2(ASCIIToUTF16("key2"));
20 const size_t kKey2Bytes = kKey2.size() * sizeof(char16); 20 const size_t kKey2Bytes = kKey2.size() * sizeof(base::char16);
21 const base::string16 kValue2(ASCIIToUTF16("value2")); 21 const base::string16 kValue2(ASCIIToUTF16("value2"));
22 const size_t kItem2Bytes = 22 const size_t kItem2Bytes =
23 (kKey2.size() + kValue2.size()) * sizeof(char16); 23 (kKey2.size() + kValue2.size()) * sizeof(base::char16);
24 const size_t kQuota = 1024; // 1K quota for this test. 24 const size_t kQuota = 1024; // 1K quota for this test.
25 25
26 scoped_refptr<DOMStorageMap> map(new DOMStorageMap(kQuota)); 26 scoped_refptr<DOMStorageMap> map(new DOMStorageMap(kQuota));
27 base::string16 old_value; 27 base::string16 old_value;
28 base::NullableString16 old_nullable_value; 28 base::NullableString16 old_nullable_value;
29 DOMStorageValuesMap swap; 29 DOMStorageValuesMap swap;
30 scoped_refptr<DOMStorageMap> copy; 30 scoped_refptr<DOMStorageMap> copy;
31 31
32 // Check the behavior of an empty map. 32 // Check the behavior of an empty map.
33 EXPECT_EQ(0u, map->Length()); 33 EXPECT_EQ(0u, map->Length());
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 // When overbudget, a new value of greater size than the existing value can 117 // When overbudget, a new value of greater size than the existing value can
118 // not be set, but a new value of lesser or equal size can be set. 118 // not be set, but a new value of lesser or equal size can be set.
119 EXPECT_TRUE(map->SetItem(kKey, kValue, &old_nullable_value)); 119 EXPECT_TRUE(map->SetItem(kKey, kValue, &old_nullable_value));
120 EXPECT_FALSE(map->SetItem(kKey, base::string16(kValue + kValue), 120 EXPECT_FALSE(map->SetItem(kKey, base::string16(kValue + kValue),
121 &old_nullable_value)); 121 &old_nullable_value));
122 EXPECT_TRUE(map->SetItem(kKey, base::string16(), &old_nullable_value)); 122 EXPECT_TRUE(map->SetItem(kKey, base::string16(), &old_nullable_value));
123 EXPECT_EQ(kValue, old_nullable_value.string()); 123 EXPECT_EQ(kValue, old_nullable_value.string());
124 } 124 }
125 125
126 } // namespace content 126 } // namespace content
OLDNEW
« no previous file with comments | « content/common/dom_storage/dom_storage_map.cc ('k') | content/common/indexed_db/indexed_db_key_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698