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

Side by Side Diff: components/test/run_all_unittests.cc

Issue 541813002: Componentize chrome/common/content_settings files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: GN fix Created 6 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 | « components/test/DEPS ('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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/metrics/statistics_recorder.h" 7 #include "base/metrics/statistics_recorder.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/test/launcher/unit_test_launcher.h" 9 #include "base/test/launcher/unit_test_launcher.h"
10 #include "base/test/test_suite.h" 10 #include "base/test/test_suite.h"
11 #include "components/content_settings/core/common/content_settings_pattern.h"
11 #include "content/public/test/test_content_client_initializer.h" 12 #include "content/public/test/test_content_client_initializer.h"
12 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
13 #include "ui/base/resource/resource_bundle.h" 14 #include "ui/base/resource/resource_bundle.h"
14 #include "ui/base/ui_base_paths.h" 15 #include "ui/base/ui_base_paths.h"
16 #include "url/url_util.h"
15 17
16 #if defined(OS_MACOSX) 18 #if defined(OS_MACOSX)
17 #include "base/mac/bundle_locations.h" 19 #include "base/mac/bundle_locations.h"
18 #endif 20 #endif
19 21
20 #if !defined(OS_IOS) 22 #if !defined(OS_IOS)
21 #include "ui/gl/gl_surface.h" 23 #include "ui/gl/gl_surface.h"
22 #endif 24 #endif
23 25
24 #if defined(OS_ANDROID) 26 #if defined(OS_ANDROID)
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 78
77 // TODO(tfarina): This should be changed to InitSharedInstanceWithPakFile() 79 // TODO(tfarina): This should be changed to InitSharedInstanceWithPakFile()
78 // so we can load our pak file instead of chrome.pak. crbug.com/348563 80 // so we can load our pak file instead of chrome.pak. crbug.com/348563
79 ui::ResourceBundle::InitSharedInstanceWithLocale( 81 ui::ResourceBundle::InitSharedInstanceWithLocale(
80 "en-US", NULL, ui::ResourceBundle::LOAD_COMMON_RESOURCES); 82 "en-US", NULL, ui::ResourceBundle::LOAD_COMMON_RESOURCES);
81 base::FilePath resources_pack_path; 83 base::FilePath resources_pack_path;
82 PathService::Get(base::DIR_MODULE, &resources_pack_path); 84 PathService::Get(base::DIR_MODULE, &resources_pack_path);
83 ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath( 85 ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath(
84 resources_pack_path.AppendASCII("resources.pak"), 86 resources_pack_path.AppendASCII("resources.pak"),
85 ui::SCALE_FACTOR_NONE); 87 ui::SCALE_FACTOR_NONE);
88
89 // These schemes need to be added globally to pass tests of
90 // autocomplete_input_unittest.cc and content_settings_pattern*
91 url::AddStandardScheme("chrome");
92 url::AddStandardScheme("chrome-extension");
93 url::AddStandardScheme("chrome-devtools");
94 url::AddStandardScheme("chrome-search");
95
96 // Not using kExtensionScheme to avoid the dependency to extensions.
97 ContentSettingsPattern::SetNonWildcardDomainNonPortScheme(
98 "chrome-extension");
86 } 99 }
87 100
88 virtual void Shutdown() OVERRIDE { 101 virtual void Shutdown() OVERRIDE {
89 ui::ResourceBundle::CleanupSharedInstance(); 102 ui::ResourceBundle::CleanupSharedInstance();
90 103
91 #if defined(OS_MACOSX) && !defined(OS_IOS) 104 #if defined(OS_MACOSX) && !defined(OS_IOS)
92 base::mac::SetOverrideFrameworkBundle(NULL); 105 base::mac::SetOverrideFrameworkBundle(NULL);
93 #endif 106 #endif
94 107
95 base::TestSuite::Shutdown(); 108 base::TestSuite::Shutdown();
(...skipping 29 matching lines...) Expand all
125 // The listener will set up common test environment for all components unit 138 // The listener will set up common test environment for all components unit
126 // tests. 139 // tests.
127 testing::TestEventListeners& listeners = 140 testing::TestEventListeners& listeners =
128 testing::UnitTest::GetInstance()->listeners(); 141 testing::UnitTest::GetInstance()->listeners();
129 listeners.Append(new ComponentsUnitTestEventListener()); 142 listeners.Append(new ComponentsUnitTestEventListener());
130 143
131 return base::LaunchUnitTests( 144 return base::LaunchUnitTests(
132 argc, argv, base::Bind(&base::TestSuite::Run, 145 argc, argv, base::Bind(&base::TestSuite::Run,
133 base::Unretained(&test_suite))); 146 base::Unretained(&test_suite)));
134 } 147 }
OLDNEW
« no previous file with comments | « components/test/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698