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

Side by Side Diff: extensions/browser/value_store/value_store_frontend_unittest.cc

Issue 388963002: Get rid of the rest of CreateStringValue (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix bad rebase Created 6 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/file_util.h" 5 #include "base/file_util.h"
6 #include "base/files/scoped_temp_dir.h" 6 #include "base/files/scoped_temp_dir.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "chrome/common/chrome_paths.h" 10 #include "chrome/common/chrome_paths.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 ASSERT_TRUE(Get("key2", &value)); 81 ASSERT_TRUE(Get("key2", &value));
82 int result; 82 int result;
83 ASSERT_TRUE(value->GetAsInteger(&result)); 83 ASSERT_TRUE(value->GetAsInteger(&result));
84 EXPECT_EQ(2, result); 84 EXPECT_EQ(2, result);
85 } 85 }
86 } 86 }
87 87
88 TEST_F(ValueStoreFrontendTest, ChangesPersistAfterReload) { 88 TEST_F(ValueStoreFrontendTest, ChangesPersistAfterReload) {
89 storage_->Set("key0", 89 storage_->Set("key0",
90 scoped_ptr<base::Value>(base::Value::CreateIntegerValue(0))); 90 scoped_ptr<base::Value>(base::Value::CreateIntegerValue(0)));
91 storage_->Set("key1", 91 storage_->Set("key1", scoped_ptr<base::Value>(new base::StringValue("new1")));
92 scoped_ptr<base::Value>(base::Value::CreateStringValue("new1")));
93 storage_->Remove("key2"); 92 storage_->Remove("key2");
94 93
95 // Reload the DB and test our changes. 94 // Reload the DB and test our changes.
96 ResetStorage(); 95 ResetStorage();
97 96
98 scoped_ptr<base::Value> value; 97 scoped_ptr<base::Value> value;
99 { 98 {
100 ASSERT_TRUE(Get("key0", &value)); 99 ASSERT_TRUE(Get("key0", &value));
101 int result; 100 int result;
102 ASSERT_TRUE(value->GetAsInteger(&result)); 101 ASSERT_TRUE(value->GetAsInteger(&result));
103 EXPECT_EQ(0, result); 102 EXPECT_EQ(0, result);
104 } 103 }
105 104
106 { 105 {
107 ASSERT_TRUE(Get("key1", &value)); 106 ASSERT_TRUE(Get("key1", &value));
108 std::string result; 107 std::string result;
109 ASSERT_TRUE(value->GetAsString(&result)); 108 ASSERT_TRUE(value->GetAsString(&result));
110 EXPECT_EQ("new1", result); 109 EXPECT_EQ("new1", result);
111 } 110 }
112 111
113 ASSERT_FALSE(Get("key2", &value)); 112 ASSERT_FALSE(Get("key2", &value));
114 } 113 }
OLDNEW
« no previous file with comments | « extensions/browser/value_store/value_store_change_unittest.cc ('k') | extensions/browser/value_store/value_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698