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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/browser/bookmarks/bookmark_model.h" | 9 #include "chrome/browser/bookmarks/bookmark_model.h" |
10 #include "chrome/browser/extensions/extension_bookmark_helpers.h" | 10 #include "chrome/browser/extensions/extension_bookmark_helpers.h" |
11 #include "chrome/browser/extensions/extension_bookmarks_module_constants.h" | 11 #include "chrome/browser/extensions/extension_bookmarks_module_constants.h" |
| 12 #include "chrome/test/testing_browser_process_test.h" |
| 13 |
12 namespace keys = extension_bookmarks_module_constants; | 14 namespace keys = extension_bookmarks_module_constants; |
13 | 15 |
14 class ExtensionBookmarksTest : public testing::Test { | 16 class ExtensionBookmarksTest : public TestingBrowserProcessTest { |
15 public: | 17 public: |
16 virtual void SetUp() { | 18 virtual void SetUp() { |
17 model_.reset(new BookmarkModel(NULL)); | 19 model_.reset(new BookmarkModel(NULL)); |
18 model_->AddURL(model_->other_node(), 0, ASCIIToUTF16("Digg"), | 20 model_->AddURL(model_->other_node(), 0, ASCIIToUTF16("Digg"), |
19 GURL("http://www.reddit.com")); | 21 GURL("http://www.reddit.com")); |
20 model_->AddURL(model_->other_node(), 0, ASCIIToUTF16("News"), | 22 model_->AddURL(model_->other_node(), 0, ASCIIToUTF16("News"), |
21 GURL("http://www.foxnews.com")); | 23 GURL("http://www.foxnews.com")); |
22 folder = model_->AddFolder( | 24 folder = model_->AddFolder( |
23 model_->other_node(), 0, ASCIIToUTF16("outer folder")); | 25 model_->other_node(), 0, ASCIIToUTF16("outer folder")); |
24 model_->AddFolder(folder, 0, ASCIIToUTF16("inner folder 1")); | 26 model_->AddFolder(folder, 0, ASCIIToUTF16("inner folder 1")); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 true); // Only folders. | 74 true); // Only folders. |
73 ListValue* children; | 75 ListValue* children; |
74 tree->GetList(keys::kChildrenKey, &children); | 76 tree->GetList(keys::kChildrenKey, &children); |
75 ASSERT_EQ(2U, children->GetSize()); | 77 ASSERT_EQ(2U, children->GetSize()); |
76 DictionaryValue* inner_folder; | 78 DictionaryValue* inner_folder; |
77 ASSERT_TRUE(children->GetDictionary(1, &inner_folder)); | 79 ASSERT_TRUE(children->GetDictionary(1, &inner_folder)); |
78 std::string title; | 80 std::string title; |
79 inner_folder->GetString(keys::kTitleKey, &title); | 81 inner_folder->GetString(keys::kTitleKey, &title); |
80 ASSERT_EQ("inner folder 1", title); | 82 ASSERT_EQ("inner folder 1", title); |
81 } | 83 } |
OLD | NEW |