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

Side by Side Diff: chrome/browser/search_engines/template_url_service_unittest.cc

Issue 3341009: Re-enable TemplateURLModel.Load on Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update to ToT. Created 9 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/callback.h" 5 #include "base/callback.h"
6 #include "base/memory/ref_counted.h" 6 #include "base/memory/ref_counted.h"
7 #include "base/memory/scoped_vector.h" 7 #include "base/memory/scoped_vector.h"
8 #include "base/string_split.h" 8 #include "base/string_split.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/threading/thread.h" 10 #include "base/threading/thread.h"
(...skipping 11 matching lines...) Expand all
22 #include "chrome/test/testing_pref_service.h" 22 #include "chrome/test/testing_pref_service.h"
23 #include "chrome/test/testing_profile.h" 23 #include "chrome/test/testing_profile.h"
24 #include "content/browser/browser_thread.h" 24 #include "content/browser/browser_thread.h"
25 #include "content/common/notification_details.h" 25 #include "content/common/notification_details.h"
26 #include "content/common/notification_source.h" 26 #include "content/common/notification_source.h"
27 #include "testing/gtest/include/gtest/gtest.h" 27 #include "testing/gtest/include/gtest/gtest.h"
28 28
29 using base::Time; 29 using base::Time;
30 using base::TimeDelta; 30 using base::TimeDelta;
31 31
32 #if defined(OS_LINUX)
33 // Timed out on Chromium Linux. http://crbug.com/53607
34 #define MAYBE_Load DISABLED_Load
35 #else
36 #define MAYBE_Load Load
37 #endif
38
39 // Test the GenerateSearchURL on a thread or the main thread. 32 // Test the GenerateSearchURL on a thread or the main thread.
40 class TestGenerateSearchURL 33 class TestGenerateSearchURL
41 : public base::RefCountedThreadSafe<TestGenerateSearchURL> { 34 : public base::RefCountedThreadSafe<TestGenerateSearchURL> {
42 public: 35 public:
43 explicit TestGenerateSearchURL(SearchTermsData* search_terms_data) 36 explicit TestGenerateSearchURL(SearchTermsData* search_terms_data)
44 : search_terms_data_(search_terms_data), 37 : search_terms_data_(search_terms_data),
45 passed_(false) { 38 passed_(false) {
46 } 39 }
47 40
48 // Run the test cases for GenerateSearchURL. 41 // Run the test cases for GenerateSearchURL.
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 // Wait for any saves to finish. 364 // Wait for any saves to finish.
372 BlockTillServiceProcessesRequests(); 365 BlockTillServiceProcessesRequests();
373 366
374 // Reload the model to verify that change was saved correctly. 367 // Reload the model to verify that change was saved correctly.
375 ResetModel(true); 368 ResetModel(true);
376 keyword_url = model()->GetTemplateURLForKeyword(ASCIIToUTF16("unittest")); 369 keyword_url = model()->GetTemplateURLForKeyword(ASCIIToUTF16("unittest"));
377 ASSERT_TRUE(keyword_url != NULL); 370 ASSERT_TRUE(keyword_url != NULL);
378 ASSERT_EQ(prepopulated_url, keyword_url->url()->DisplayURL()); 371 ASSERT_EQ(prepopulated_url, keyword_url->url()->DisplayURL());
379 } 372 }
380 373
381 TEST_F(TemplateURLServiceTest, MAYBE_Load) { 374 TEST_F(TemplateURLServiceTest, Load) {
382 VerifyLoad(); 375 VerifyLoad();
383 } 376 }
384 377
385 TEST_F(TemplateURLServiceTest, AddUpdateRemove) { 378 TEST_F(TemplateURLServiceTest, AddUpdateRemove) {
386 // Add a new TemplateURL. 379 // Add a new TemplateURL.
387 VerifyLoad(); 380 VerifyLoad();
388 const size_t initial_count = model()->GetTemplateURLs().size(); 381 const size_t initial_count = model()->GetTemplateURLs().size();
389 382
390 TemplateURL* t_url = new TemplateURL(); 383 TemplateURL* t_url = new TemplateURL();
391 t_url->SetURL("http://www.google.com/foo/bar", 0, 0); 384 t_url->SetURL("http://www.google.com/foo/bar", 0, 0);
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after
1188 kEncodings, ""); 1181 kEncodings, "");
1189 VerifyObserverFired(); 1182 VerifyObserverFired();
1190 EXPECT_TRUE(model()->is_default_search_managed()); 1183 EXPECT_TRUE(model()->is_default_search_managed());
1191 EXPECT_EQ(2 + initial_count, model()->GetTemplateURLs().size()); 1184 EXPECT_EQ(2 + initial_count, model()->GetTemplateURLs().size());
1192 1185
1193 // Verify that the default manager we are getting is the managed one. 1186 // Verify that the default manager we are getting is the managed one.
1194 actual_managed_default = model()->GetDefaultSearchProvider(); 1187 actual_managed_default = model()->GetDefaultSearchProvider();
1195 ExpectSimilar(actual_managed_default, expected_managed_default1.get()); 1188 ExpectSimilar(actual_managed_default, expected_managed_default1.get());
1196 EXPECT_EQ(actual_managed_default->show_in_default_list(), true); 1189 EXPECT_EQ(actual_managed_default->show_in_default_list(), true);
1197 } 1190 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698