OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/extensions/api/bookmarks/bookmark_api_helpers.h" | 5 #include "chrome/browser/extensions/api/bookmarks/bookmark_api_helpers.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 namespace keys = bookmark_api_constants; | 24 namespace keys = bookmark_api_constants; |
25 using api::bookmarks::BookmarkTreeNode; | 25 using api::bookmarks::BookmarkTreeNode; |
26 | 26 |
27 namespace bookmark_api_helpers { | 27 namespace bookmark_api_helpers { |
28 | 28 |
29 class ExtensionBookmarksTest : public testing::Test { | 29 class ExtensionBookmarksTest : public testing::Test { |
30 public: | 30 public: |
31 ExtensionBookmarksTest() | 31 ExtensionBookmarksTest() |
32 : client_(NULL), model_(NULL), node_(NULL), node2_(NULL), folder_(NULL) {} | 32 : client_(NULL), model_(NULL), node_(NULL), node2_(NULL), folder_(NULL) {} |
33 | 33 |
34 virtual void SetUp() OVERRIDE { | 34 virtual void SetUp() override { |
35 profile_.CreateBookmarkModel(false); | 35 profile_.CreateBookmarkModel(false); |
36 model_ = BookmarkModelFactory::GetForProfile(&profile_); | 36 model_ = BookmarkModelFactory::GetForProfile(&profile_); |
37 client_ = ChromeBookmarkClientFactory::GetForProfile(&profile_); | 37 client_ = ChromeBookmarkClientFactory::GetForProfile(&profile_); |
38 test::WaitForBookmarkModelToLoad(model_); | 38 test::WaitForBookmarkModelToLoad(model_); |
39 | 39 |
40 node_ = model_->AddURL(model_->other_node(), 0, base::ASCIIToUTF16("Digg"), | 40 node_ = model_->AddURL(model_->other_node(), 0, base::ASCIIToUTF16("Digg"), |
41 GURL("http://www.reddit.com")); | 41 GURL("http://www.reddit.com")); |
42 model_->SetNodeMetaInfo(node_, "some_key1", "some_value1"); | 42 model_->SetNodeMetaInfo(node_, "some_key1", "some_value1"); |
43 model_->SetNodeMetaInfo(node_, "some_key2", "some_value2"); | 43 model_->SetNodeMetaInfo(node_, "some_key2", "some_value2"); |
44 model_->AddURL(model_->other_node(), 0, base::ASCIIToUTF16("News"), | 44 model_->AddURL(model_->other_node(), 0, base::ASCIIToUTF16("News"), |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 string_value.clear(); | 227 string_value.clear(); |
228 EXPECT_FALSE(dictionary_value->GetString("some_key1", &string_value)); | 228 EXPECT_FALSE(dictionary_value->GetString("some_key1", &string_value)); |
229 EXPECT_EQ("", string_value); | 229 EXPECT_EQ("", string_value); |
230 EXPECT_TRUE(dictionary_value->GetString("some_key2", &string_value)); | 230 EXPECT_TRUE(dictionary_value->GetString("some_key2", &string_value)); |
231 EXPECT_EQ("some_value2", string_value); | 231 EXPECT_EQ("some_value2", string_value); |
232 | 232 |
233 } | 233 } |
234 | 234 |
235 } // namespace bookmark_api_helpers | 235 } // namespace bookmark_api_helpers |
236 } // namespace extensions | 236 } // namespace extensions |
OLD | NEW |