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

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

Issue 10440014: Correctly whitelist ftp directory listings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 8 years, 7 months 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "googleurl/src/gurl.h" 9 #include "googleurl/src/gurl.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 GURL())); 42 GURL()));
43 43
44 GURL file_url("file:///dir/"); 44 GURL file_url("file:///dir/");
45 EXPECT_TRUE(ContentSettingsObserver::IsWhitelistedForContentSettings( 45 EXPECT_TRUE(ContentSettingsObserver::IsWhitelistedForContentSettings(
46 WebSecurityOrigin::create(file_url), 46 WebSecurityOrigin::create(file_url),
47 GURL("file:///dir/"))); 47 GURL("file:///dir/")));
48 EXPECT_FALSE(ContentSettingsObserver::IsWhitelistedForContentSettings( 48 EXPECT_FALSE(ContentSettingsObserver::IsWhitelistedForContentSettings(
49 WebSecurityOrigin::create(file_url), 49 WebSecurityOrigin::create(file_url),
50 GURL("file:///dir/file"))); 50 GURL("file:///dir/file")));
51 51
52 GURL ftp_url("ftp:///dir/");
53 EXPECT_TRUE(ContentSettingsObserver::IsWhitelistedForContentSettings(
54 WebSecurityOrigin::create(ftp_url),
55 GURL("ftp:///dir/")));
56 EXPECT_FALSE(ContentSettingsObserver::IsWhitelistedForContentSettings(
57 WebSecurityOrigin::create(ftp_url),
58 GURL("ftp:///dir/file")));
59
60 GURL http_url = 52 GURL http_url =
61 GURL("http://server.com/path"); 53 GURL("http://server.com/path");
62 EXPECT_FALSE(ContentSettingsObserver::IsWhitelistedForContentSettings( 54 EXPECT_FALSE(ContentSettingsObserver::IsWhitelistedForContentSettings(
63 WebSecurityOrigin::create(http_url), 55 WebSecurityOrigin::create(http_url),
64 GURL())); 56 GURL()));
65 } 57 }
OLDNEW
« no previous file with comments | « chrome/renderer/content_settings_observer.cc ('k') | webkit/glue/ftp_directory_listing_response_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698