OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/browser/media/media_internals.h" | 5 #include "content/browser/media/media_internals.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "content/public/test/test_browser_thread.h" | 10 #include "content/public/test/test_browser_thread.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 void SendUpdate(const std::string& function, base::Value* value) { | 47 void SendUpdate(const std::string& function, base::Value* value) { |
48 internals_->SendUpdate(function, value); | 48 internals_->SendUpdate(function, value); |
49 } | 49 } |
50 | 50 |
51 protected: | 51 protected: |
52 virtual void SetUp() { | 52 virtual void SetUp() { |
53 internals_.reset(new MediaInternals()); | 53 internals_.reset(new MediaInternals()); |
54 } | 54 } |
55 | 55 |
56 MessageLoop loop_; | 56 base::MessageLoop loop_; |
57 TestBrowserThread io_thread_; | 57 TestBrowserThread io_thread_; |
58 scoped_ptr<MediaInternals> internals_; | 58 scoped_ptr<MediaInternals> internals_; |
59 }; | 59 }; |
60 | 60 |
61 TEST_F(MediaInternalsTest, UpdateAddsNewItem) { | 61 TEST_F(MediaInternalsTest, UpdateAddsNewItem) { |
62 UpdateItem("some.item", "testing", new base::FundamentalValue(true)); | 62 UpdateItem("some.item", "testing", new base::FundamentalValue(true)); |
63 bool testing = false; | 63 bool testing = false; |
64 std::string id; | 64 std::string id; |
65 | 65 |
66 EXPECT_TRUE(data()->GetBoolean("some.item.testing", &testing)); | 66 EXPECT_TRUE(data()->GetBoolean("some.item.testing", &testing)); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 DeleteItem("some.item"); | 125 DeleteItem("some.item"); |
126 EXPECT_FALSE(data()->Get("some.item", &out)); | 126 EXPECT_FALSE(data()->Get("some.item", &out)); |
127 EXPECT_TRUE(data()->Get("some", &out)); | 127 EXPECT_TRUE(data()->Get("some", &out)); |
128 | 128 |
129 DeleteItem("some"); | 129 DeleteItem("some"); |
130 EXPECT_FALSE(data()->Get("some.item", &out)); | 130 EXPECT_FALSE(data()->Get("some.item", &out)); |
131 EXPECT_FALSE(data()->Get("some", &out)); | 131 EXPECT_FALSE(data()->Get("some", &out)); |
132 } | 132 } |
133 | 133 |
134 } // namespace content | 134 } // namespace content |
OLD | NEW |