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

Side by Side Diff: chrome/app/resources/resources_unittest.cc

Issue 1845343005: Makes MaterialDesignController initialization explicit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments Created 4 years, 8 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/app/chrome_main_delegate.cc ('k') | chrome/browser/chrome_browser_main.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 <string> 5 #include <string>
6 6
7 #include "base/files/file_enumerator.h" 7 #include "base/files/file_enumerator.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
11 11
12 #include "chrome/grit/chromium_strings.h" 12 #include "chrome/grit/chromium_strings.h"
13 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
14 14
15 #include "ui/base/l10n/l10n_util.h" 15 #include "ui/base/l10n/l10n_util.h"
16 #include "ui/base/material_design/material_design_controller.h"
16 #include "ui/base/resource/resource_bundle.h" 17 #include "ui/base/resource/resource_bundle.h"
17 #include "ui/base/ui_base_paths.h" 18 #include "ui/base/ui_base_paths.h"
18 19
19 class ResourcesTest : public ::testing::Test { 20 class ResourcesTest : public ::testing::Test {
20 protected: 21 protected:
21 ResourcesTest() { 22 ResourcesTest() {
22 ui::RegisterPathProvider(); 23 ui::RegisterPathProvider();
24 ui::MaterialDesignController::Initialize();
23 ResourceBundle::InitSharedInstanceWithLocale( 25 ResourceBundle::InitSharedInstanceWithLocale(
24 "en-US", nullptr, ResourceBundle::LOAD_COMMON_RESOURCES); 26 "en-US", nullptr, ResourceBundle::LOAD_COMMON_RESOURCES);
25 } 27 }
26 28
27 ~ResourcesTest() override { ResourceBundle::CleanupSharedInstance(); } 29 ~ResourcesTest() override { ResourceBundle::CleanupSharedInstance(); }
28 }; 30 };
29 31
30 // Trailing whitespace has been the cause of a bug in the past. Make sure this 32 // Trailing whitespace has been the cause of a bug in the past. Make sure this
31 // never happens again on messages where this matter. 33 // never happens again on messages where this matter.
32 TEST_F(ResourcesTest, CriticalMessagesContainNoExtraWhitespaces) { 34 TEST_F(ResourcesTest, CriticalMessagesContainNoExtraWhitespaces) {
(...skipping 13 matching lines...) Expand all
46 ResourceBundle::GetSharedInstance().OverrideLocalePakForTest( 48 ResourceBundle::GetSharedInstance().OverrideLocalePakForTest(
47 locale_file_path); 49 locale_file_path);
48 ResourceBundle::GetSharedInstance().ReloadLocaleResources(""); 50 ResourceBundle::GetSharedInstance().ReloadLocaleResources("");
49 51
50 for (int message : messages_to_check) { 52 for (int message : messages_to_check) {
51 base::string16 message_str = l10n_util::GetStringUTF16(message); 53 base::string16 message_str = l10n_util::GetStringUTF16(message);
52 EXPECT_EQ(message_str, base::TrimWhitespace(message_str, base::TRIM_ALL)); 54 EXPECT_EQ(message_str, base::TrimWhitespace(message_str, base::TRIM_ALL));
53 } 55 }
54 } 56 }
55 } 57 }
OLDNEW
« no previous file with comments | « chrome/app/chrome_main_delegate.cc ('k') | chrome/browser/chrome_browser_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698