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

Side by Side Diff: third_party/libaddressinput/chromium/cpp/test/storage_test_runner.cc

Issue 148463003: libaddressinput - reduce number of copies in storage class by 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment Created 6 years, 10 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
« no previous file with comments | « third_party/libaddressinput/chromium/cpp/test/retriever_test.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (C) 2013 Google Inc. 1 // Copyright (C) 2013 Google Inc.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 ClearValues(); 56 ClearValues();
57 storage_->Get("key", BuildCallback()); 57 storage_->Get("key", BuildCallback());
58 58
59 EXPECT_FALSE(success_); 59 EXPECT_FALSE(success_);
60 EXPECT_EQ("key", key_); 60 EXPECT_EQ("key", key_);
61 EXPECT_TRUE(data_.empty()); 61 EXPECT_TRUE(data_.empty());
62 } 62 }
63 63
64 void StorageTestRunner::GetReturnsWhatWasPut() { 64 void StorageTestRunner::GetReturnsWhatWasPut() {
65 ClearValues(); 65 ClearValues();
66 storage_->Put("key", "value"); 66 storage_->Put("key", make_scoped_ptr(new std::string("value")));
67 storage_->Get("key", BuildCallback()); 67 storage_->Get("key", BuildCallback());
68 68
69 EXPECT_TRUE(success_); 69 EXPECT_TRUE(success_);
70 EXPECT_EQ("key", key_); 70 EXPECT_EQ("key", key_);
71 EXPECT_EQ("value", data_); 71 EXPECT_EQ("value", data_);
72 } 72 }
73 73
74 void StorageTestRunner::SecondPutOverwritesData() { 74 void StorageTestRunner::SecondPutOverwritesData() {
75 ClearValues(); 75 ClearValues();
76 storage_->Put("key", "bad-value"); 76 storage_->Put("key", make_scoped_ptr(new std::string("bad-value")));
77 storage_->Put("key", "good-value"); 77 storage_->Put("key", make_scoped_ptr(new std::string("good-value")));
78 storage_->Get("key", BuildCallback()); 78 storage_->Get("key", BuildCallback());
79 79
80 EXPECT_TRUE(success_); 80 EXPECT_TRUE(success_);
81 EXPECT_EQ("key", key_); 81 EXPECT_EQ("key", key_);
82 EXPECT_EQ("good-value", data_); 82 EXPECT_EQ("good-value", data_);
83 } 83 }
84 84
85 } // addressinput 85 } // addressinput
86 } // i18n 86 } // i18n
OLDNEW
« no previous file with comments | « third_party/libaddressinput/chromium/cpp/test/retriever_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698