OLD | NEW |
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 Loading... |
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 |
OLD | NEW |