Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Side by Side Diff: chrome/browser/ui/gtk/bookmarks/bookmark_editor_gtk_unittest.cc

Issue 7465041: GTTF: Use a fresh TestingBrowserProcess for each test, part #4 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: should work Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <gtk/gtk.h> 5 #include <gtk/gtk.h>
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
11 #include "chrome/browser/bookmarks/bookmark_model.h" 11 #include "chrome/browser/bookmarks/bookmark_model.h"
12 #include "chrome/browser/ui/gtk/bookmarks/bookmark_editor_gtk.h" 12 #include "chrome/browser/ui/gtk/bookmarks/bookmark_editor_gtk.h"
13 #include "chrome/browser/ui/gtk/bookmarks/bookmark_tree_model.h" 13 #include "chrome/browser/ui/gtk/bookmarks/bookmark_tree_model.h"
14 #include "chrome/test/testing_browser_process_test.h"
14 #include "chrome/test/testing_profile.h" 15 #include "chrome/test/testing_profile.h"
15 #include "content/browser/browser_thread.h" 16 #include "content/browser/browser_thread.h"
16 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
17 18
18 using base::Time; 19 using base::Time;
19 using base::TimeDelta; 20 using base::TimeDelta;
20 using bookmark_utils::GetTitleFromTreeIter; 21 using bookmark_utils::GetTitleFromTreeIter;
21 22
22 // Base class for bookmark editor tests. This class is a copy from 23 // Base class for bookmark editor tests. This class is a copy from
23 // bookmark_editor_view_unittest.cc, and all the tests in this file are 24 // bookmark_editor_view_unittest.cc, and all the tests in this file are
24 // GTK-ifications of the corresponding views tests. Testing here is really 25 // GTK-ifications of the corresponding views tests. Testing here is really
25 // important because on Linux, we make round trip copies from chrome's 26 // important because on Linux, we make round trip copies from chrome's
26 // BookmarkModel class to GTK's native GtkTreeStore. 27 // BookmarkModel class to GTK's native GtkTreeStore.
27 class BookmarkEditorGtkTest : public testing::Test { 28 class BookmarkEditorGtkTest : public TestingBrowserProcessTest {
28 public: 29 public:
29 BookmarkEditorGtkTest() 30 BookmarkEditorGtkTest()
30 : ui_thread_(BrowserThread::UI, &message_loop_), 31 : ui_thread_(BrowserThread::UI, &message_loop_),
31 file_thread_(BrowserThread::FILE, &message_loop_), 32 file_thread_(BrowserThread::FILE, &message_loop_),
32 model_(NULL) { 33 model_(NULL) {
33 } 34 }
34 35
35 virtual void SetUp() { 36 virtual void SetUp() {
36 profile_.reset(new TestingProfile()); 37 profile_.reset(new TestingProfile());
37 profile_->CreateBookmarkModel(true); 38 profile_->CreateBookmarkModel(true);
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 gtk_entry_set_text(GTK_ENTRY(editor.name_entry_), "new_a"); 330 gtk_entry_set_text(GTK_ENTRY(editor.name_entry_), "new_a");
330 331
331 editor.ApplyEdits(); 332 editor.ApplyEdits();
332 333
333 const BookmarkNode* other_node = profile_->GetBookmarkModel()->other_node(); 334 const BookmarkNode* other_node = profile_->GetBookmarkModel()->other_node();
334 ASSERT_EQ(2, other_node->child_count()); 335 ASSERT_EQ(2, other_node->child_count());
335 336
336 const BookmarkNode* new_node = other_node->GetChild(0); 337 const BookmarkNode* new_node = other_node->GetChild(0);
337 EXPECT_EQ(ASCIIToUTF16("new_a"), new_node->GetTitle()); 338 EXPECT_EQ(ASCIIToUTF16("new_a"), new_node->GetTitle());
338 } 339 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698