| 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/bookmarks/bookmark_model.h" | 5 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
| (...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 886 profile_.reset(NULL); | 886 profile_.reset(NULL); |
| 887 profile_.reset(new TestingProfile()); | 887 profile_.reset(new TestingProfile()); |
| 888 profile_->CreateHistoryService(true, false); | 888 profile_->CreateHistoryService(true, false); |
| 889 } | 889 } |
| 890 | 890 |
| 891 // The profile. | 891 // The profile. |
| 892 scoped_ptr<TestingProfile> profile_; | 892 scoped_ptr<TestingProfile> profile_; |
| 893 BookmarkModel* bb_model_; | 893 BookmarkModel* bb_model_; |
| 894 | 894 |
| 895 private: | 895 private: |
| 896 MessageLoopForUI message_loop_; | 896 base::MessageLoopForUI message_loop_; |
| 897 content::TestBrowserThread ui_thread_; | 897 content::TestBrowserThread ui_thread_; |
| 898 content::TestBrowserThread file_thread_; | 898 content::TestBrowserThread file_thread_; |
| 899 }; | 899 }; |
| 900 | 900 |
| 901 // Creates a set of nodes in the bookmark bar model, then recreates the | 901 // Creates a set of nodes in the bookmark bar model, then recreates the |
| 902 // bookmark bar model which triggers loading from the db and checks the loaded | 902 // bookmark bar model which triggers loading from the db and checks the loaded |
| 903 // structure to make sure it is what we first created. | 903 // structure to make sure it is what we first created. |
| 904 TEST_F(BookmarkModelTestWithProfile, CreateAndRestore) { | 904 TEST_F(BookmarkModelTestWithProfile, CreateAndRestore) { |
| 905 struct TestData { | 905 struct TestData { |
| 906 // Structure of the children of the bookmark bar model node. | 906 // Structure of the children of the bookmark bar model node. |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1085 | 1085 |
| 1086 EXPECT_TRUE(node.DeleteMetaInfo("key1")); | 1086 EXPECT_TRUE(node.DeleteMetaInfo("key1")); |
| 1087 EXPECT_TRUE(node.DeleteMetaInfo("key2")); | 1087 EXPECT_TRUE(node.DeleteMetaInfo("key2")); |
| 1088 EXPECT_FALSE(node.DeleteMetaInfo("key3")); | 1088 EXPECT_FALSE(node.DeleteMetaInfo("key3")); |
| 1089 EXPECT_FALSE(node.GetMetaInfo("key1", &out_value)); | 1089 EXPECT_FALSE(node.GetMetaInfo("key1", &out_value)); |
| 1090 EXPECT_FALSE(node.GetMetaInfo("key2", &out_value)); | 1090 EXPECT_FALSE(node.GetMetaInfo("key2", &out_value)); |
| 1091 EXPECT_TRUE(node.meta_info_str().empty()); | 1091 EXPECT_TRUE(node.meta_info_str().empty()); |
| 1092 } | 1092 } |
| 1093 | 1093 |
| 1094 } // namespace | 1094 } // namespace |
| OLD | NEW |