| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_test_helpers.h" | 5 #include "chrome/browser/bookmarks/bookmark_test_helpers.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
| 12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 13 #include "chrome/browser/bookmarks/bookmark_model.h" | |
| 14 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 13 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 15 #include "components/bookmarks/core/browser/base_bookmark_model_observer.h" | 14 #include "components/bookmarks/core/browser/base_bookmark_model_observer.h" |
| 15 #include "components/bookmarks/core/browser/bookmark_model.h" |
| 16 #include "content/public/test/test_utils.h" | 16 #include "content/public/test/test_utils.h" |
| 17 #include "url/gurl.h" | 17 #include "url/gurl.h" |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 // BookmarkLoadObserver is used when blocking until the BookmarkModel finishes | 21 // BookmarkLoadObserver is used when blocking until the BookmarkModel finishes |
| 22 // loading. As soon as the BookmarkModel finishes loading the message loop is | 22 // loading. As soon as the BookmarkModel finishes loading the message loop is |
| 23 // quit. | 23 // quit. |
| 24 class BookmarkLoadObserver : public BaseBookmarkModelObserver { | 24 class BookmarkLoadObserver : public BaseBookmarkModelObserver { |
| 25 public: | 25 public: |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 const BookmarkNode* node, | 133 const BookmarkNode* node, |
| 134 const std::string& model_string) { | 134 const std::string& model_string) { |
| 135 DCHECK(node); | 135 DCHECK(node); |
| 136 std::string::size_type start_pos = 0; | 136 std::string::size_type start_pos = 0; |
| 137 std::string::size_type end_pos = | 137 std::string::size_type end_pos = |
| 138 AddNodesFromString(model, node, model_string, start_pos); | 138 AddNodesFromString(model, node, model_string, start_pos); |
| 139 DCHECK(end_pos == std::string::npos); | 139 DCHECK(end_pos == std::string::npos); |
| 140 } | 140 } |
| 141 | 141 |
| 142 } // namespace test | 142 } // namespace test |
| OLD | NEW |