| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/renderer/chrome_content_renderer_client.h" | 5 #include "chrome/renderer/chrome_content_renderer_client.h" |
| 6 | 6 |
| 7 #include <vector> |
| 8 |
| 7 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/common/extensions/extension.h" | 10 #include "chrome/common/extensions/extension.h" |
| 9 #include "chrome/common/extensions/extension_builder.h" | 11 #include "chrome/common/extensions/extension_builder.h" |
| 12 #include "chrome/renderer/searchbox/search_bouncer.h" |
| 10 #include "content/public/common/webplugininfo.h" | 13 #include "content/public/common/webplugininfo.h" |
| 11 #include "extensions/common/manifest_constants.h" | 14 #include "extensions/common/manifest_constants.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 13 #include "third_party/WebKit/public/platform/WebString.h" | 16 #include "third_party/WebKit/public/platform/WebString.h" |
| 14 #include "third_party/WebKit/public/platform/WebVector.h" | 17 #include "third_party/WebKit/public/platform/WebVector.h" |
| 15 #include "third_party/WebKit/public/web/WebPluginParams.h" | 18 #include "third_party/WebKit/public/web/WebPluginParams.h" |
| 16 #include "url/gurl.h" | 19 #include "url/gurl.h" |
| 17 | 20 |
| 18 using WebKit::WebPluginParams; | 21 using WebKit::WebPluginParams; |
| 19 using WebKit::WebString; | 22 using WebKit::WebString; |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 #else | 375 #else |
| 373 EXPECT_FALSE(test.AllowPepperMediaStreamAPI(GURL(kChatAppURL1))); | 376 EXPECT_FALSE(test.AllowPepperMediaStreamAPI(GURL(kChatAppURL1))); |
| 374 EXPECT_FALSE(test.AllowPepperMediaStreamAPI(GURL(kChatAppURL2))); | 377 EXPECT_FALSE(test.AllowPepperMediaStreamAPI(GURL(kChatAppURL2))); |
| 375 #endif | 378 #endif |
| 376 EXPECT_FALSE(test.AllowPepperMediaStreamAPI( | 379 EXPECT_FALSE(test.AllowPepperMediaStreamAPI( |
| 377 GURL("http://talkgadget.google.com"))); | 380 GURL("http://talkgadget.google.com"))); |
| 378 EXPECT_FALSE(test.AllowPepperMediaStreamAPI( | 381 EXPECT_FALSE(test.AllowPepperMediaStreamAPI( |
| 379 GURL("https://talkgadget.evil.com"))); | 382 GURL("https://talkgadget.evil.com"))); |
| 380 } | 383 } |
| 381 | 384 |
| 385 TEST_F(ChromeContentRendererClientTest, ShouldSuppressErrorPage) { |
| 386 ChromeContentRendererClient client; |
| 387 client.search_bouncer_.reset(new SearchBouncer); |
| 388 client.search_bouncer_->OnSetSearchURLs( |
| 389 std::vector<GURL>(), GURL("http://example.com/n")); |
| 390 EXPECT_FALSE(client.ShouldSuppressErrorPage(GURL("http://example.com"))); |
| 391 EXPECT_TRUE(client.ShouldSuppressErrorPage(GURL("http://example.com/n"))); |
| 392 } |
| 393 |
| 382 } // namespace chrome | 394 } // namespace chrome |
| OLD | NEW |