Index: content/browser/download/download_item_impl_unittest.cc |
diff --git a/content/browser/download/download_item_impl_unittest.cc b/content/browser/download/download_item_impl_unittest.cc |
index a794d3fd21979ecf411a1451731d887d5d7f88f6..55bad0e4ee00185d9c0ec1dc5d98fe6d03882efd 100644 |
--- a/content/browser/download/download_item_impl_unittest.cc |
+++ b/content/browser/download/download_item_impl_unittest.cc |
@@ -294,9 +294,11 @@ class TestExternalData : public DownloadItem::ExternalData { |
TEST_F(DownloadItemTest, ExternalData) { |
DownloadItem* item = CreateDownloadItem(DownloadItem::IN_PROGRESS); |
+ const DownloadItem* const_item = item; |
// Shouldn't be anything there before set. |
EXPECT_EQ(NULL, item->GetExternalData(&external_data_test_string)); |
+ EXPECT_EQ(NULL, const_item->GetExternalData(&external_data_test_string)); |
TestExternalData* test1(new TestExternalData()); |
test1->value = 2; |
@@ -308,6 +310,13 @@ TEST_F(DownloadItemTest, ExternalData) { |
item->GetExternalData(&external_data_test_string)); |
EXPECT_EQ(test1, test_result); |
+ // Ditto for const lookup. |
+ const TestExternalData* test_const_result = |
+ static_cast<const TestExternalData*>( |
+ const_item->GetExternalData(&external_data_test_string)); |
+ EXPECT_EQ(static_cast<const TestExternalData*>(test1), |
+ test_const_result); |
+ |
// Destructor should be called if value overwritten. New value |
// should then be retrievable. |
TestExternalData* test2(new TestExternalData()); |