| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ui/search/search_ipc_router.h" | 5 #include "chrome/browser/ui/search/search_ipc_router.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/ui/search/search_ipc_router_policy_impl.h" | 8 #include "chrome/browser/ui/search/search_ipc_router_policy_impl.h" |
| 9 #include "chrome/browser/ui/search/search_tab_helper.h" | 9 #include "chrome/browser/ui/search/search_tab_helper.h" |
| 10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
| 11 #include "chrome/common/url_constants.h" | 11 #include "chrome/common/url_constants.h" |
| 12 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 12 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 #include "url/gurl.h" | 14 #include "url/gurl.h" |
| 15 | 15 |
| 16 class SearchIPCRouterPolicyTest : public ChromeRenderViewHostTestHarness { | 16 class SearchIPCRouterPolicyTest : public ChromeRenderViewHostTestHarness { |
| 17 public: | 17 public: |
| 18 virtual void SetUp() { | 18 virtual void SetUp() { |
| 19 CommandLine::ForCurrentProcess()->AppendSwitch( | |
| 20 switches::kEnableInstantExtendedAPI); | |
| 21 ChromeRenderViewHostTestHarness::SetUp(); | 19 ChromeRenderViewHostTestHarness::SetUp(); |
| 22 SearchTabHelper::CreateForWebContents(web_contents()); | 20 SearchTabHelper::CreateForWebContents(web_contents()); |
| 23 } | 21 } |
| 24 }; | 22 }; |
| 25 | 23 |
| 26 TEST_F(SearchIPCRouterPolicyTest, ProcessVoiceSearchSupportMsg) { | 24 TEST_F(SearchIPCRouterPolicyTest, ProcessVoiceSearchSupportMsg) { |
| 27 NavigateAndCommit(GURL("chrome-search://foo/bar")); | 25 NavigateAndCommit(GURL("chrome-search://foo/bar")); |
| 28 SearchTabHelper* search_tab_helper = | 26 SearchTabHelper* search_tab_helper = |
| 29 SearchTabHelper::FromWebContents(web_contents()); | 27 SearchTabHelper::FromWebContents(web_contents()); |
| 30 ASSERT_NE(static_cast<SearchTabHelper*>(NULL), search_tab_helper); | 28 ASSERT_NE(static_cast<SearchTabHelper*>(NULL), search_tab_helper); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 SearchTabHelper* search_tab_helper = | 111 SearchTabHelper* search_tab_helper = |
| 114 SearchTabHelper::FromWebContents(web_contents()); | 112 SearchTabHelper::FromWebContents(web_contents()); |
| 115 ASSERT_NE(static_cast<SearchTabHelper*>(NULL), search_tab_helper); | 113 ASSERT_NE(static_cast<SearchTabHelper*>(NULL), search_tab_helper); |
| 116 SearchIPCRouterPolicyImpl* policy = | 114 SearchIPCRouterPolicyImpl* policy = |
| 117 static_cast<SearchIPCRouterPolicyImpl*>( | 115 static_cast<SearchIPCRouterPolicyImpl*>( |
| 118 search_tab_helper->ipc_router().policy()); | 116 search_tab_helper->ipc_router().policy()); |
| 119 policy->set_is_incognito(true); | 117 policy->set_is_incognito(true); |
| 120 ASSERT_FALSE(search_tab_helper->ipc_router().policy()-> | 118 ASSERT_FALSE(search_tab_helper->ipc_router().policy()-> |
| 121 ShouldSendThemeBackgroundInfo()); | 119 ShouldSendThemeBackgroundInfo()); |
| 122 } | 120 } |
| OLD | NEW |