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