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