summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_bookmarks_unittest.cc
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-22 16:53:55 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-22 16:53:55 +0000
commit7509874518456dc2b495eed8256bef6da77ae59b (patch)
tree5201c55f1d6ff832c7f03d4919d148997a078911 /chrome/browser/extensions/extension_bookmarks_unittest.cc
parent3adab215b78455efc2e3c8d86eb7a8513a25211b (diff)
downloadchromium_src-7509874518456dc2b495eed8256bef6da77ae59b.zip
chromium_src-7509874518456dc2b495eed8256bef6da77ae59b.tar.gz
chromium_src-7509874518456dc2b495eed8256bef6da77ae59b.tar.bz2
Adding ASSERT to avoid crash if GetDictionary fails to find value. Also fixed some lint issues.
Minor Coverity issue (9399 and 9400). BUG=None TEST=Part of unit test. Review URL: http://codereview.chromium.org/3014024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53347 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_bookmarks_unittest.cc')
-rw-r--r--chrome/browser/extensions/extension_bookmarks_unittest.cc38
1 files changed, 19 insertions, 19 deletions
diff --git a/chrome/browser/extensions/extension_bookmarks_unittest.cc b/chrome/browser/extensions/extension_bookmarks_unittest.cc
index 4b1070e..e0dd270 100644
--- a/chrome/browser/extensions/extension_bookmarks_unittest.cc
+++ b/chrome/browser/extensions/extension_bookmarks_unittest.cc
@@ -25,55 +25,55 @@ class ExtensionBookmarksTest : public testing::Test {
model_->AddURL(folder, 0, L"Digg", GURL("http://reddit.com"));
model_->AddURL(folder, 0, L"CNet", GURL("http://cnet.com"));
}
-
+
scoped_ptr<BookmarkModel> model_;
const BookmarkNode* folder;
};
TEST_F(ExtensionBookmarksTest, GetFullTreeFromRoot) {
- DictionaryValue* tree =
- extension_bookmark_helpers::GetNodeDictionary(model_->other_node(),
- true, // recurse
- false); // not only folders
+ DictionaryValue* tree = extension_bookmark_helpers::GetNodeDictionary(
+ model_->other_node(),
+ true, // Recurse.
+ false); // Not only folders.
ListValue* children;
tree->GetList(keys::kChildrenKey, &children);
ASSERT_EQ(3U, children->GetSize());
}
TEST_F(ExtensionBookmarksTest, GetFoldersOnlyFromRoot) {
- DictionaryValue* tree =
- extension_bookmark_helpers::GetNodeDictionary(model_->other_node(),
- true, // recurse
- true); // only folders
+ DictionaryValue* tree = extension_bookmark_helpers::GetNodeDictionary(
+ model_->other_node(),
+ true, // Recurse.
+ true); // Only folders.
ListValue* children;
tree->GetList(keys::kChildrenKey, &children);
ASSERT_EQ(1U, children->GetSize());
}
TEST_F(ExtensionBookmarksTest, GetSubtree) {
- DictionaryValue* tree =
- extension_bookmark_helpers::GetNodeDictionary(folder,
- true, // recurse
- false); // not only folders
+ DictionaryValue* tree = extension_bookmark_helpers::GetNodeDictionary(
+ folder,
+ true, // Recurse.
+ false); // Not only folders.
ListValue* children;
tree->GetList(keys::kChildrenKey, &children);
ASSERT_EQ(4U, children->GetSize());
DictionaryValue* digg;
- children->GetDictionary(1,&digg);
+ ASSERT_TRUE(children->GetDictionary(1, &digg));
std::string title;
digg->GetString(keys::kTitleKey, &title);
ASSERT_EQ("Digg", title);
}
TEST_F(ExtensionBookmarksTest, GetSubtreeFoldersOnly) {
- DictionaryValue* tree =
- extension_bookmark_helpers::GetNodeDictionary(folder,
- true, // recurse
- true); // only folders
+ DictionaryValue* tree = extension_bookmark_helpers::GetNodeDictionary(
+ folder,
+ true, // Recurse.
+ true); // Only folders.
ListValue* children;
tree->GetList(keys::kChildrenKey, &children);
ASSERT_EQ(2U, children->GetSize());
DictionaryValue* inner_folder;
- children->GetDictionary(1,&inner_folder);
+ ASSERT_TRUE(children->GetDictionary(1, &inner_folder));
std::string title;
inner_folder->GetString(keys::kTitleKey, &title);
ASSERT_EQ("inner folder 1", title);