| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <windows.h> | 5 #include <windows.h> |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| 11 #include "chrome/browser/template_url.h" | 11 #include "chrome/browser/template_url.h" |
| 12 #include "chrome/browser/template_url_model.h" | 12 #include "chrome/browser/template_url_model.h" |
| 13 #include "chrome/common/pref_service.h" | 13 #include "chrome/common/pref_service.h" |
| 14 #include "chrome/test/testing_profile.h" | 14 #include "chrome/test/testing_profile.h" |
| 15 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 17 | 17 |
| 18 using base::Time; |
| 19 using base::TimeDelta; |
| 20 |
| 18 // A Task used to coordinate when the database has finished processing | 21 // A Task used to coordinate when the database has finished processing |
| 19 // requests. See note in BlockTillServiceProcessesRequests for details. | 22 // requests. See note in BlockTillServiceProcessesRequests for details. |
| 20 // | 23 // |
| 21 // When Run() schedules a QuitTask on the message loop it was created with. | 24 // When Run() schedules a QuitTask on the message loop it was created with. |
| 22 class QuitTask2 : public Task { | 25 class QuitTask2 : public Task { |
| 23 public: | 26 public: |
| 24 QuitTask2() : main_loop_(MessageLoop::current()) {} | 27 QuitTask2() : main_loop_(MessageLoop::current()) {} |
| 25 | 28 |
| 26 virtual void Run() { | 29 virtual void Run() { |
| 27 main_loop_->PostTask(FROM_HERE, new MessageLoop::QuitTask()); | 30 main_loop_->PostTask(FROM_HERE, new MessageLoop::QuitTask()); |
| (...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 VerifyObserverCount(1); | 626 VerifyObserverCount(1); |
| 624 | 627 |
| 625 // Make sure the host->TemplateURL map was updated appropriately. | 628 // Make sure the host->TemplateURL map was updated appropriately. |
| 626 ASSERT_EQ(t_url, model_->GetTemplateURLForHost("foo.com")); | 629 ASSERT_EQ(t_url, model_->GetTemplateURLForHost("foo.com")); |
| 627 EXPECT_TRUE(model_->GetTemplateURLForHost("google.com") == NULL); | 630 EXPECT_TRUE(model_->GetTemplateURLForHost("google.com") == NULL); |
| 628 EXPECT_EQ("foo.com", t_url->url()->GetHost()); | 631 EXPECT_EQ("foo.com", t_url->url()->GetHost()); |
| 629 EXPECT_EQ(L"foo.com", t_url->keyword()); | 632 EXPECT_EQ(L"foo.com", t_url->keyword()); |
| 630 EXPECT_EQ(L"http://foo.com/?q=x", t_url->url()->ReplaceSearchTerms(*t_url, | 633 EXPECT_EQ(L"http://foo.com/?q=x", t_url->url()->ReplaceSearchTerms(*t_url, |
| 631 L"x", TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring())); | 634 L"x", TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring())); |
| 632 } | 635 } |
| 633 | |
| OLD | NEW |