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

Side by Side Diff: chrome/test/ppapi/ppapi_test.cc

Issue 1312453005: Removed Profile::GetHostContentSettingsMap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed patch conflict Created 5 years, 3 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/test/ppapi/ppapi_interactive_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/test/ppapi/ppapi_test.h" 5 #include "chrome/test/ppapi/ppapi_test.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
11 #include "base/single_thread_task_runner.h" 11 #include "base/single_thread_task_runner.h"
12 #include "base/strings/string_util.h" 12 #include "base/strings/string_util.h"
13 #include "base/strings/stringprintf.h" 13 #include "base/strings/stringprintf.h"
14 #include "base/thread_task_runner_handle.h" 14 #include "base/thread_task_runner_handle.h"
15 #include "chrome/browser/chrome_notification_types.h" 15 #include "chrome/browser/chrome_notification_types.h"
16 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
16 #include "chrome/browser/infobars/infobar_service.h" 17 #include "chrome/browser/infobars/infobar_service.h"
17 #include "chrome/browser/profiles/profile.h" 18 #include "chrome/browser/profiles/profile.h"
18 #include "chrome/browser/ui/browser.h" 19 #include "chrome/browser/ui/browser.h"
19 #include "chrome/browser/ui/tabs/tab_strip_model.h" 20 #include "chrome/browser/ui/tabs/tab_strip_model.h"
20 #include "chrome/common/chrome_paths.h" 21 #include "chrome/common/chrome_paths.h"
21 #include "chrome/common/chrome_switches.h" 22 #include "chrome/common/chrome_switches.h"
22 #include "chrome/test/base/test_switches.h" 23 #include "chrome/test/base/test_switches.h"
23 #include "chrome/test/base/ui_test_utils.h" 24 #include "chrome/test/base/ui_test_utils.h"
24 #include "components/content_settings/core/browser/host_content_settings_map.h" 25 #include "components/content_settings/core/browser/host_content_settings_map.h"
25 #include "components/infobars/core/confirm_infobar_delegate.h" 26 #include "components/infobars/core/confirm_infobar_delegate.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 // Some stuff is hung off of the testing interface which is not enabled 139 // Some stuff is hung off of the testing interface which is not enabled
139 // by default. 140 // by default.
140 command_line->AppendSwitch(switches::kEnablePepperTesting); 141 command_line->AppendSwitch(switches::kEnablePepperTesting);
141 142
142 // Smooth scrolling confuses the scrollbar test. 143 // Smooth scrolling confuses the scrollbar test.
143 command_line->AppendSwitch(switches::kDisableSmoothScrolling); 144 command_line->AppendSwitch(switches::kDisableSmoothScrolling);
144 } 145 }
145 146
146 void PPAPITestBase::SetUpOnMainThread() { 147 void PPAPITestBase::SetUpOnMainThread() {
147 // Always allow access to the PPAPI broker. 148 // Always allow access to the PPAPI broker.
148 browser()->profile()->GetHostContentSettingsMap()->SetDefaultContentSetting( 149 HostContentSettingsMapFactory::GetForProfile(browser()->profile())
149 CONTENT_SETTINGS_TYPE_PPAPI_BROKER, CONTENT_SETTING_ALLOW); 150 ->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_PPAPI_BROKER,
151 CONTENT_SETTING_ALLOW);
150 } 152 }
151 153
152 GURL PPAPITestBase::GetTestFileUrl(const std::string& test_case) { 154 GURL PPAPITestBase::GetTestFileUrl(const std::string& test_case) {
153 base::FilePath test_path; 155 base::FilePath test_path;
154 EXPECT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &test_path)); 156 EXPECT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &test_path));
155 test_path = test_path.Append(FILE_PATH_LITERAL("ppapi")); 157 test_path = test_path.Append(FILE_PATH_LITERAL("ppapi"));
156 test_path = test_path.Append(FILE_PATH_LITERAL("tests")); 158 test_path = test_path.Append(FILE_PATH_LITERAL("tests"));
157 test_path = test_path.Append(FILE_PATH_LITERAL("test_case.html")); 159 test_path = test_path.Append(FILE_PATH_LITERAL("test_case.html"));
158 160
159 // Sanity check the file name. 161 // Sanity check the file name.
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 const std::string& base, 450 const std::string& base,
449 const std::string& test_case) { 451 const std::string& test_case) {
450 return base::StringPrintf("%smode=nacl_newlib&testcase=%s", base.c_str(), 452 return base::StringPrintf("%smode=nacl_newlib&testcase=%s", base.c_str(),
451 test_case.c_str()); 453 test_case.c_str());
452 } 454 }
453 455
454 void PPAPIBrokerInfoBarTest::SetUpOnMainThread() { 456 void PPAPIBrokerInfoBarTest::SetUpOnMainThread() {
455 // The default content setting for the PPAPI broker is ASK. We purposefully 457 // The default content setting for the PPAPI broker is ASK. We purposefully
456 // don't call PPAPITestBase::SetUpOnMainThread() to keep it that way. 458 // don't call PPAPITestBase::SetUpOnMainThread() to keep it that way.
457 } 459 }
OLDNEW
« no previous file with comments | « chrome/test/ppapi/ppapi_interactive_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698