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

Side by Side Diff: chrome/browser/autocomplete/keyword_provider_unittest.cc

Issue 6478005: GTTF: Use a fresh TestingBrowserProcess for each test, part #1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make more tests use the new base class Created 9 years, 10 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 "base/message_loop.h" 5 #include "base/message_loop.h"
6 #include "base/utf_string_conversions.h" 6 #include "base/utf_string_conversions.h"
7 #include "chrome/browser/autocomplete/autocomplete_match.h" 7 #include "chrome/browser/autocomplete/autocomplete_match.h"
8 #include "chrome/browser/autocomplete/keyword_provider.h" 8 #include "chrome/browser/autocomplete/keyword_provider.h"
9 #include "chrome/browser/search_engines/template_url.h" 9 #include "chrome/browser/search_engines/template_url.h"
10 #include "chrome/browser/search_engines/template_url_model.h" 10 #include "chrome/browser/search_engines/template_url_model.h"
11 #include "chrome/test/testing_browser_process.h"
12 #include "chrome/test/testing_browser_process_test.h"
11 #include "googleurl/src/gurl.h" 13 #include "googleurl/src/gurl.h"
12 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
13 15
14 class KeywordProviderTest : public testing::Test { 16 class KeywordProviderTest : public TestingBrowserProcessTest {
15 protected: 17 protected:
16 template<class ResultType> 18 template<class ResultType>
17 struct test_data { 19 struct test_data {
18 const string16 input; 20 const string16 input;
19 const size_t num_results; 21 const size_t num_results;
20 const ResultType output[3]; 22 const ResultType output[3];
21 }; 23 };
22 24
23 KeywordProviderTest() : kw_provider_(NULL) { } 25 KeywordProviderTest() : kw_provider_(NULL) { }
24 virtual ~KeywordProviderTest() { } 26 virtual ~KeywordProviderTest() { }
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 template_url->set_short_name(ASCIIToUTF16("Test")); 209 template_url->set_short_name(ASCIIToUTF16("Test"));
208 model_->Add(template_url); 210 model_->Add(template_url);
209 ASSERT_TRUE(template_url == model_->GetTemplateURLForKeyword(keyword)); 211 ASSERT_TRUE(template_url == model_->GetTemplateURLForKeyword(keyword));
210 } 212 }
211 213
212 TEST_F(KeywordProviderTest, RemoveKeyword) { 214 TEST_F(KeywordProviderTest, RemoveKeyword) {
213 string16 url(ASCIIToUTF16("http://aaaa/?aaaa=1&b={searchTerms}&c")); 215 string16 url(ASCIIToUTF16("http://aaaa/?aaaa=1&b={searchTerms}&c"));
214 model_->Remove(model_->GetTemplateURLForKeyword(ASCIIToUTF16("aaaa"))); 216 model_->Remove(model_->GetTemplateURLForKeyword(ASCIIToUTF16("aaaa")));
215 ASSERT_TRUE(model_->GetTemplateURLForKeyword(ASCIIToUTF16("aaaa")) == NULL); 217 ASSERT_TRUE(model_->GetTemplateURLForKeyword(ASCIIToUTF16("aaaa")) == NULL);
216 } 218 }
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/history_url_provider_unittest.cc ('k') | chrome/browser/autocomplete/search_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698