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

Unified Diff: mojo/public/cpp/bindings/tests/map_unittest.cc

Issue 646773005: mojo: Switch the clipboard interface over to using map<>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unit test. Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/cpp/bindings/map.h ('k') | mojo/services/clipboard/clipboard_standalone_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/tests/map_unittest.cc
diff --git a/mojo/public/cpp/bindings/tests/map_unittest.cc b/mojo/public/cpp/bindings/tests/map_unittest.cc
index 159afb9578e0381da85f6ff5a811ca77398de8c9..f3884f7e78fae552e0404b7e93d0be6a9662e4a0 100644
--- a/mojo/public/cpp/bindings/tests/map_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/map_unittest.cc
@@ -50,6 +50,17 @@ TEST_F(MapTest, InsertWorks) {
}
}
+TEST_F(MapTest, TestIndexOperator) {
+ Map<String, int> map;
+ for (size_t i = 0; i < kStringIntDataSize; ++i)
+ map[kStringIntData[i].string_data] = kStringIntData[i].int_data;
viettrungluu 2014/10/15 23:54:06 Two things: - maybe test map[foo] when used strict
+
+ for (size_t i = 0; i < kStringIntDataSize; ++i) {
+ EXPECT_EQ(kStringIntData[i].int_data,
+ map.at(kStringIntData[i].string_data));
+ }
+}
+
TEST_F(MapTest, ConstructedFromArray) {
Array<String> keys(kStringIntDataSize);
Array<int> values(kStringIntDataSize);
« no previous file with comments | « mojo/public/cpp/bindings/map.h ('k') | mojo/services/clipboard/clipboard_standalone_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698