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

Side by Side Diff: chrome/browser/download/download_prefs_unittest.cc

Issue 1658793002: Update chrome for new prefs location. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « chrome/browser/download/download_prefs.cc ('k') | chrome/browser/download/download_query.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/download/download_prefs.h" 5 #include "chrome/browser/download/download_prefs.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/prefs/pref_service.h"
9 #include "chrome/browser/download/download_extensions.h" 8 #include "chrome/browser/download/download_extensions.h"
10 #include "chrome/common/pref_names.h" 9 #include "chrome/common/pref_names.h"
11 #include "chrome/test/base/testing_profile.h" 10 #include "chrome/test/base/testing_profile.h"
11 #include "components/prefs/pref_service.h"
12 #include "content/public/test/test_browser_thread_bundle.h" 12 #include "content/public/test/test_browser_thread_bundle.h"
13 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
14 14
15 TEST(DownloadPrefsTest, Prerequisites) { 15 TEST(DownloadPrefsTest, Prerequisites) {
16 // Most of the tests below are based on the assumption that .swf files are not 16 // Most of the tests below are based on the assumption that .swf files are not
17 // allowed to open automatically, and that .txt files are allowed. If this 17 // allowed to open automatically, and that .txt files are allowed. If this
18 // assumption changes, then we need to update the tests to match. 18 // assumption changes, then we need to update the tests to match.
19 ASSERT_FALSE(download_util::IsAllowedToOpenAutomatically( 19 ASSERT_FALSE(download_util::IsAllowedToOpenAutomatically(
20 base::FilePath(FILE_PATH_LITERAL("a.swf")))); 20 base::FilePath(FILE_PATH_LITERAL("a.swf"))));
21 ASSERT_TRUE(download_util::IsAllowedToOpenAutomatically( 21 ASSERT_TRUE(download_util::IsAllowedToOpenAutomatically(
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 108
109 EXPECT_TRUE(prefs.IsAutoOpenEnabledBasedOnExtension( 109 EXPECT_TRUE(prefs.IsAutoOpenEnabledBasedOnExtension(
110 base::FilePath(FILE_PATH_LITERAL("x.txt")))); 110 base::FilePath(FILE_PATH_LITERAL("x.txt"))));
111 EXPECT_TRUE(prefs.IsAutoOpenEnabledBasedOnExtension( 111 EXPECT_TRUE(prefs.IsAutoOpenEnabledBasedOnExtension(
112 base::FilePath(FILE_PATH_LITERAL("x.TXT")))); 112 base::FilePath(FILE_PATH_LITERAL("x.TXT"))));
113 EXPECT_TRUE(prefs.IsAutoOpenEnabledBasedOnExtension( 113 EXPECT_TRUE(prefs.IsAutoOpenEnabledBasedOnExtension(
114 base::FilePath(FILE_PATH_LITERAL("x.foo")))); 114 base::FilePath(FILE_PATH_LITERAL("x.foo"))));
115 EXPECT_TRUE(prefs.IsAutoOpenEnabledBasedOnExtension( 115 EXPECT_TRUE(prefs.IsAutoOpenEnabledBasedOnExtension(
116 base::FilePath(FILE_PATH_LITERAL("x.Bar")))); 116 base::FilePath(FILE_PATH_LITERAL("x.Bar"))));
117 } 117 }
OLDNEW
« no previous file with comments | « chrome/browser/download/download_prefs.cc ('k') | chrome/browser/download/download_query.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698