OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
7 #include "base/string16.h" | 7 #include "base/string16.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/bookmarks/bookmark_model.h" | 9 #include "chrome/browser/bookmarks/bookmark_model.h" |
10 #include "chrome/browser/bookmarks/bookmark_node_data.h" | 10 #include "chrome/browser/bookmarks/bookmark_node_data.h" |
11 #include "chrome/test/base/testing_profile.h" | 11 #include "chrome/test/base/testing_profile.h" |
| 12 #include "chrome/test/testing_browser_process_test.h" |
12 #include "content/browser/browser_thread.h" | 13 #include "content/browser/browser_thread.h" |
13 #include "googleurl/src/gurl.h" | 14 #include "googleurl/src/gurl.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
15 #include "ui/base/dragdrop/os_exchange_data.h" | 16 #include "ui/base/dragdrop/os_exchange_data.h" |
16 #include "ui/base/dragdrop/os_exchange_data_provider_win.h" | 17 #include "ui/base/dragdrop/os_exchange_data_provider_win.h" |
17 | 18 |
18 class BookmarkNodeDataTest : public testing::Test { | 19 class BookmarkNodeDataTest : public TestingBrowserProcessTest { |
19 public: | 20 public: |
20 BookmarkNodeDataTest() | 21 BookmarkNodeDataTest() |
21 : ui_thread_(BrowserThread::UI, &loop_), | 22 : ui_thread_(BrowserThread::UI, &loop_), |
22 file_thread_(BrowserThread::FILE, &loop_) { } | 23 file_thread_(BrowserThread::FILE, &loop_) { } |
23 | 24 |
24 private: | 25 private: |
25 MessageLoop loop_; | 26 MessageLoop loop_; |
26 BrowserThread ui_thread_; | 27 BrowserThread ui_thread_; |
27 BrowserThread file_thread_; | 28 BrowserThread file_thread_; |
28 }; | 29 }; |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 // And make sure we get the node back. | 235 // And make sure we get the node back. |
235 std::vector<const BookmarkNode*> read_nodes = read_data.GetNodes(&profile); | 236 std::vector<const BookmarkNode*> read_nodes = read_data.GetNodes(&profile); |
236 ASSERT_EQ(2, read_nodes.size()); | 237 ASSERT_EQ(2, read_nodes.size()); |
237 EXPECT_TRUE(read_nodes[0] == folder); | 238 EXPECT_TRUE(read_nodes[0] == folder); |
238 EXPECT_TRUE(read_nodes[1] == url_node); | 239 EXPECT_TRUE(read_nodes[1] == url_node); |
239 | 240 |
240 // Asking for the first node should return NULL with more than one element | 241 // Asking for the first node should return NULL with more than one element |
241 // present. | 242 // present. |
242 EXPECT_TRUE(read_data.GetFirstNode(&profile) == NULL); | 243 EXPECT_TRUE(read_data.GetFirstNode(&profile) == NULL); |
243 } | 244 } |
OLD | NEW |