| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/string_util.h" | 5 #include "base/string_util.h" |
| 6 #include "chrome/browser/bookmarks/bookmark_model.h" | 6 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 7 #include "chrome/browser/bookmarks/bookmark_codec.h" | 7 #include "chrome/browser/bookmarks/bookmark_codec.h" |
| 8 #include "chrome/common/chrome_constants.h" | 8 #include "chrome/common/chrome_constants.h" |
| 9 #include "chrome/common/chrome_paths.h" | 9 #include "chrome/common/chrome_paths.h" |
| 10 #include "chrome/common/notification_registrar.h" | 10 #include "chrome/common/notification_registrar.h" |
| 11 #include "chrome/test/testing_profile.h" | 11 #include "chrome/test/testing_profile.h" |
| 12 #include "chrome/views/tree_node_model.h" | 12 #include "chrome/views/tree_node_model.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 | 14 |
| 15 using base::Time; |
| 16 using base::TimeDelta; |
| 17 |
| 15 class BookmarkModelTest : public testing::Test, public BookmarkModelObserver { | 18 class BookmarkModelTest : public testing::Test, public BookmarkModelObserver { |
| 16 public: | 19 public: |
| 17 struct ObserverDetails { | 20 struct ObserverDetails { |
| 18 ObserverDetails() { | 21 ObserverDetails() { |
| 19 Set(NULL, NULL, -1, -1); | 22 Set(NULL, NULL, -1, -1); |
| 20 } | 23 } |
| 21 | 24 |
| 22 void Set(BookmarkNode* node1, | 25 void Set(BookmarkNode* node1, |
| 23 BookmarkNode* node2, | 26 BookmarkNode* node2, |
| 24 int index1, | 27 int index1, |
| (...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 814 bb_model_->SetURLStarred(url, std::wstring(), true); | 817 bb_model_->SetURLStarred(url, std::wstring(), true); |
| 815 | 818 |
| 816 profile_->GetHistoryService(Profile::EXPLICIT_ACCESS)->AddPage( | 819 profile_->GetHistoryService(Profile::EXPLICIT_ACCESS)->AddPage( |
| 817 url, NULL, 1, GURL(), PageTransition::TYPED, | 820 url, NULL, 1, GURL(), PageTransition::TYPED, |
| 818 HistoryService::RedirectList()); | 821 HistoryService::RedirectList()); |
| 819 | 822 |
| 820 // This won't actually delete the URL, rather it'll empty out the visits. | 823 // This won't actually delete the URL, rather it'll empty out the visits. |
| 821 // This triggers blocking on the BookmarkModel. | 824 // This triggers blocking on the BookmarkModel. |
| 822 profile_->GetHistoryService(Profile::EXPLICIT_ACCESS)->DeleteURL(url); | 825 profile_->GetHistoryService(Profile::EXPLICIT_ACCESS)->DeleteURL(url); |
| 823 } | 826 } |
| OLD | NEW |