| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/content_settings/host_content_settings_map.h" | 5 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 6 #include "chrome/browser/history/history_service_factory.h" | 6 #include "chrome/browser/history/history_service_factory.h" |
| 7 #include "chrome/browser/instant/instant_loader.h" | 7 #include "chrome/browser/instant/instant_loader.h" |
| 8 #include "chrome/browser/instant/instant_service.h" | 8 #include "chrome/browser/instant/instant_service.h" |
| 9 #include "chrome/browser/instant/instant_service_factory.h" | 9 #include "chrome/browser/instant/instant_service_factory.h" |
| 10 #include "chrome/browser/instant/instant_test_utils.h" | 10 #include "chrome/browser/instant/instant_test_utils.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "chrome/test/base/ui_test_utils.h" | 21 #include "chrome/test/base/ui_test_utils.h" |
| 22 #include "content/public/browser/render_process_host.h" | 22 #include "content/public/browser/render_process_host.h" |
| 23 #include "content/public/browser/web_contents.h" | 23 #include "content/public/browser/web_contents.h" |
| 24 #include "grit/generated_resources.h" | 24 #include "grit/generated_resources.h" |
| 25 #include "ui/base/l10n/l10n_util.h" | 25 #include "ui/base/l10n/l10n_util.h" |
| 26 | 26 |
| 27 class InstantTest : public InstantTestBase { | 27 class InstantTest : public InstantTestBase { |
| 28 protected: | 28 protected: |
| 29 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 29 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
| 30 ASSERT_TRUE(test_server()->Start()); | 30 ASSERT_TRUE(test_server()->Start()); |
| 31 instant_url_ = test_server()->GetURL("files/instant.html"); | 31 instant_url_ = test_server()->GetURL("files/instant.html?"); |
| 32 } | 32 } |
| 33 | 33 |
| 34 bool UpdateSearchState(content::WebContents* contents) WARN_UNUSED_RESULT { | 34 bool UpdateSearchState(content::WebContents* contents) WARN_UNUSED_RESULT { |
| 35 return GetIntFromJS(contents, "onvisibilitycalls", &onvisibilitycalls_) && | 35 return GetIntFromJS(contents, "onvisibilitycalls", &onvisibilitycalls_) && |
| 36 GetIntFromJS(contents, "onchangecalls", &onchangecalls_) && | 36 GetIntFromJS(contents, "onchangecalls", &onchangecalls_) && |
| 37 GetIntFromJS(contents, "onsubmitcalls", &onsubmitcalls_) && | 37 GetIntFromJS(contents, "onsubmitcalls", &onsubmitcalls_) && |
| 38 GetIntFromJS(contents, "oncancelcalls", &oncancelcalls_) && | 38 GetIntFromJS(contents, "oncancelcalls", &oncancelcalls_) && |
| 39 GetIntFromJS(contents, "onresizecalls", &onresizecalls_) && | 39 GetIntFromJS(contents, "onresizecalls", &onresizecalls_) && |
| 40 GetStringFromJS(contents, "value", &value_) && | 40 GetStringFromJS(contents, "value", &value_) && |
| 41 GetBoolFromJS(contents, "verbatim", &verbatim_) && | 41 GetBoolFromJS(contents, "verbatim", &verbatim_) && |
| (...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1016 content::WebContents* active_tab = | 1016 content::WebContents* active_tab = |
| 1017 browser()->tab_strip_model()->GetActiveWebContents(); | 1017 browser()->tab_strip_model()->GetActiveWebContents(); |
| 1018 EXPECT_TRUE(instant_service->IsInstantProcess( | 1018 EXPECT_TRUE(instant_service->IsInstantProcess( |
| 1019 active_tab->GetRenderProcessHost()->GetID())); | 1019 active_tab->GetRenderProcessHost()->GetID())); |
| 1020 | 1020 |
| 1021 // Navigating away should change the process. | 1021 // Navigating away should change the process. |
| 1022 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL)); | 1022 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL)); |
| 1023 EXPECT_FALSE(instant_service->IsInstantProcess( | 1023 EXPECT_FALSE(instant_service->IsInstantProcess( |
| 1024 active_tab->GetRenderProcessHost()->GetID())); | 1024 active_tab->GetRenderProcessHost()->GetID())); |
| 1025 } | 1025 } |
| OLD | NEW |