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

Side by Side Diff: chrome/renderer/content_settings_observer_unittest.cc

Issue 105723002: Add the scheme chrome-distiller:// and hook up data source. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years 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) 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/content_settings_observer.h" 5 #include "chrome/renderer/content_settings_observer.h"
6 6
7 #include "chrome/common/url_constants.h" 7 #include "chrome/common/url_constants.h"
8 #include "content/public/common/url_constants.h" 8 #include "content/public/common/url_constants.h"
9 #include "extensions/common/constants.h" 9 #include "extensions/common/constants.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 12 matching lines...) Expand all
23 EXPECT_TRUE(ContentSettingsObserver::IsWhitelistedForContentSettings( 23 EXPECT_TRUE(ContentSettingsObserver::IsWhitelistedForContentSettings(
24 WebSecurityOrigin::create(chrome_ui_url), 24 WebSecurityOrigin::create(chrome_ui_url),
25 GURL())); 25 GURL()));
26 26
27 GURL chrome_dev_tools_url = 27 GURL chrome_dev_tools_url =
28 GURL(std::string(chrome::kChromeDevToolsScheme).append(end_url)); 28 GURL(std::string(chrome::kChromeDevToolsScheme).append(end_url));
29 EXPECT_TRUE(ContentSettingsObserver::IsWhitelistedForContentSettings( 29 EXPECT_TRUE(ContentSettingsObserver::IsWhitelistedForContentSettings(
30 WebSecurityOrigin::create(chrome_dev_tools_url), 30 WebSecurityOrigin::create(chrome_dev_tools_url),
31 GURL())); 31 GURL()));
32 32
33 GURL dom_distiller_url =
34 GURL(std::string(chrome::kDomDistillerScheme).append(end_url));
35 EXPECT_TRUE(ContentSettingsObserver::IsWhitelistedForContentSettings(
36 WebSecurityOrigin::create(dom_distiller_url),
37 GURL()));
38
33 GURL extension_url = 39 GURL extension_url =
34 GURL(std::string(extensions::kExtensionScheme).append(end_url)); 40 GURL(std::string(extensions::kExtensionScheme).append(end_url));
35 EXPECT_TRUE(ContentSettingsObserver::IsWhitelistedForContentSettings( 41 EXPECT_TRUE(ContentSettingsObserver::IsWhitelistedForContentSettings(
36 WebSecurityOrigin::create(extension_url), 42 WebSecurityOrigin::create(extension_url),
37 GURL())); 43 GURL()));
38 44
39 GURL chrome_internal_url = 45 GURL chrome_internal_url =
40 GURL(std::string(chrome::kChromeInternalScheme).append(end_url)); 46 GURL(std::string(chrome::kChromeInternalScheme).append(end_url));
41 EXPECT_TRUE(ContentSettingsObserver::IsWhitelistedForContentSettings( 47 EXPECT_TRUE(ContentSettingsObserver::IsWhitelistedForContentSettings(
42 WebSecurityOrigin::create(chrome_internal_url), 48 WebSecurityOrigin::create(chrome_internal_url),
43 GURL())); 49 GURL()));
44 50
45 GURL file_url("file:///dir/"); 51 GURL file_url("file:///dir/");
46 EXPECT_TRUE(ContentSettingsObserver::IsWhitelistedForContentSettings( 52 EXPECT_TRUE(ContentSettingsObserver::IsWhitelistedForContentSettings(
47 WebSecurityOrigin::create(file_url), 53 WebSecurityOrigin::create(file_url),
48 GURL("file:///dir/"))); 54 GURL("file:///dir/")));
49 EXPECT_FALSE(ContentSettingsObserver::IsWhitelistedForContentSettings( 55 EXPECT_FALSE(ContentSettingsObserver::IsWhitelistedForContentSettings(
50 WebSecurityOrigin::create(file_url), 56 WebSecurityOrigin::create(file_url),
51 GURL("file:///dir/file"))); 57 GURL("file:///dir/file")));
52 58
53 GURL http_url = 59 GURL http_url =
54 GURL("http://server.com/path"); 60 GURL("http://server.com/path");
55 EXPECT_FALSE(ContentSettingsObserver::IsWhitelistedForContentSettings( 61 EXPECT_FALSE(ContentSettingsObserver::IsWhitelistedForContentSettings(
56 WebSecurityOrigin::create(http_url), 62 WebSecurityOrigin::create(http_url),
57 GURL())); 63 GURL()));
58 } 64 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698