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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 public: | 36 public: |
37 ExtensionBookmarksTest() | 37 ExtensionBookmarksTest() |
38 : managed_(NULL), | 38 : managed_(NULL), |
39 model_(NULL), | 39 model_(NULL), |
40 node_(NULL), | 40 node_(NULL), |
41 node2_(NULL), | 41 node2_(NULL), |
42 folder_(NULL) {} | 42 folder_(NULL) {} |
43 | 43 |
44 void SetUp() override { | 44 void SetUp() override { |
45 profile_.CreateBookmarkModel(false); | 45 profile_.CreateBookmarkModel(false); |
46 model_ = BookmarkModelFactory::GetForProfile(&profile_); | 46 model_ = BookmarkModelFactory::GetForBrowserContext(&profile_); |
47 managed_ = ManagedBookmarkServiceFactory::GetForProfile(&profile_); | 47 managed_ = ManagedBookmarkServiceFactory::GetForProfile(&profile_); |
48 bookmarks::test::WaitForBookmarkModelToLoad(model_); | 48 bookmarks::test::WaitForBookmarkModelToLoad(model_); |
49 | 49 |
50 node_ = model_->AddURL(model_->other_node(), 0, base::ASCIIToUTF16("Digg"), | 50 node_ = model_->AddURL(model_->other_node(), 0, base::ASCIIToUTF16("Digg"), |
51 GURL("http://www.reddit.com")); | 51 GURL("http://www.reddit.com")); |
52 model_->SetNodeMetaInfo(node_, "some_key1", "some_value1"); | 52 model_->SetNodeMetaInfo(node_, "some_key1", "some_value1"); |
53 model_->SetNodeMetaInfo(node_, "some_key2", "some_value2"); | 53 model_->SetNodeMetaInfo(node_, "some_key2", "some_value2"); |
54 model_->AddURL(model_->other_node(), 0, base::ASCIIToUTF16("News"), | 54 model_->AddURL(model_->other_node(), 0, base::ASCIIToUTF16("News"), |
55 GURL("http://www.foxnews.com")); | 55 GURL("http://www.foxnews.com")); |
56 folder_ = model_->AddFolder( | 56 folder_ = model_->AddFolder( |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 string_value.clear(); | 225 string_value.clear(); |
226 EXPECT_FALSE(dictionary_value->GetString("some_key1", &string_value)); | 226 EXPECT_FALSE(dictionary_value->GetString("some_key1", &string_value)); |
227 EXPECT_EQ("", string_value); | 227 EXPECT_EQ("", string_value); |
228 EXPECT_TRUE(dictionary_value->GetString("some_key2", &string_value)); | 228 EXPECT_TRUE(dictionary_value->GetString("some_key2", &string_value)); |
229 EXPECT_EQ("some_value2", string_value); | 229 EXPECT_EQ("some_value2", string_value); |
230 | 230 |
231 } | 231 } |
232 | 232 |
233 } // namespace bookmark_api_helpers | 233 } // namespace bookmark_api_helpers |
234 } // namespace extensions | 234 } // namespace extensions |
OLD | NEW |