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 "chrome/browser/bookmarks/bookmark_expanded_state_tracker.h" | 5 #include "chrome/browser/bookmarks/bookmark_expanded_state_tracker.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/bookmarks/bookmark_model.h" | 8 #include "chrome/browser/bookmarks/bookmark_model.h" |
9 #include "chrome/test/base/testing_browser_process_test.h" | |
10 #include "chrome/test/base/testing_profile.h" | 9 #include "chrome/test/base/testing_profile.h" |
11 #include "content/browser/browser_thread.h" | 10 #include "content/browser/browser_thread.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
13 | 12 |
14 class BookmarkExpandedStateTrackerTest : public TestingBrowserProcessTest { | 13 class BookmarkExpandedStateTrackerTest : public testing::Test { |
15 public: | 14 public: |
16 BookmarkExpandedStateTrackerTest(); | 15 BookmarkExpandedStateTrackerTest(); |
17 | 16 |
18 virtual void SetUp() OVERRIDE; | 17 virtual void SetUp() OVERRIDE; |
19 virtual void TearDown() OVERRIDE; | 18 virtual void TearDown() OVERRIDE; |
20 | 19 |
21 protected: | 20 protected: |
22 BookmarkModel* GetModel(); | 21 BookmarkModel* GetModel(); |
23 | 22 |
24 private: | 23 private: |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 nodes.insert(n1); | 67 nodes.insert(n1); |
69 tracker->SetExpandedNodes(nodes); | 68 tracker->SetExpandedNodes(nodes); |
70 EXPECT_EQ(nodes, tracker->GetExpandedNodes()); | 69 EXPECT_EQ(nodes, tracker->GetExpandedNodes()); |
71 | 70 |
72 // Remove the folder, which should remove it from the list of expanded nodes. | 71 // Remove the folder, which should remove it from the list of expanded nodes. |
73 model->Remove(model->bookmark_bar_node(), 0); | 72 model->Remove(model->bookmark_bar_node(), 0); |
74 nodes.erase(n1); | 73 nodes.erase(n1); |
75 n1 = NULL; | 74 n1 = NULL; |
76 EXPECT_EQ(nodes, tracker->GetExpandedNodes()); | 75 EXPECT_EQ(nodes, tracker->GetExpandedNodes()); |
77 } | 76 } |
OLD | NEW |