[LSC] Remove UTF8ToUTF16 from Literals without Escape Sequences
This change removes calls to base::UTF8ToUTF16 with a single-line string literal not containing escape sequences and replaces them with a u"..." literal instead. This is a mechanical change: $ git grep -lw UTF8ToUTF16 | \ xargs sed -i 's/\(base::\)\?UTF8ToUTF16(\("[^\\"]*"\))/u\2/g' $ git cl format AX-Relnotes: n/a. Bug: 1189439 Change-Id: I6df2e531f62926a12be3f610ce8627d94ec407f6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2776021 Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org> Commit-Queue: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Owners-Override: Daniel Cheng <dcheng@chromium.org> Cr-Commit-Position: refs/heads/master@{#865390}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
d82d122f4e
commit
2c470ea5c9
android_webview/browser
ash
app_list
assistant
ui
main_stage
clipboard
clipboard_history_resource_manager.ccclipboard_history_resource_manager_unittest.ccclipboard_history_unittest.ccclipboard_history_util_unittest.cc
display
drag_drop
login
ui
projector
public
cpp
external_arc
system
ime_menu
locale
message_center
ash_message_popup_collection_unittest.ccinactive_user_notification_blocker_unittest.ccmessage_center_utils_unittest.ccnotification_swipe_control_view_unittest.ccsession_state_notification_blocker_unittest.ccunified_message_center_bubble_unittest.ccunified_message_center_view_unittest.ccunified_message_list_view_unittest.cc
phonehub
screen_layout_observer.ccscreen_layout_observer_unittest.cctray
unified
wm
base
chrome
browser
android
contextualsearch
history_report
apps
guest_view
ash
arc
accessibility
app_shortcuts
login
web_applications
background
certificate_manager_model_unittest.ccchrome_service_worker_browsertest.ccchromeos
child_accounts
screen_time_controller_browsertest.cc
time_limits
file_manager
input_method
assistive_window_controller_unittest.ccemoji_suggester.ccemoji_suggester_unittest.ccgrammar_service_client_unittest.ccinput_method_engine_browsertests.ccnative_input_method_engine_browsertest.ccpersonal_info_suggester_unittest.cctextinput_surroundingtext_browsertest.cc
ui
phonehub
policy
ui
content_settings
download
enterprise
extensions
api
crx_installer_browsertest.ccextension_context_menu_browsertest.ccextension_error_ui_default_unittest.ccextension_service_unittest.ccforced_extensions
lazy_background_page_apitest.ccplugin_manager.cchistory
loader
media
webrtc
metrics
mouse_events_interactive_uitest.ccnotifications
notification_platform_bridge_linux.ccnotification_platform_bridge_linux_unittest.ccnotification_platform_bridge_mac.mmnotification_platform_bridge_mac_unittest.mmnotification_platform_bridge_mac_unnotification.mmnotification_platform_bridge_mac_unnotification_unittest.mmnotification_platform_bridge_mac_utils.mmnotification_platform_bridge_mac_utils_unittest.mmnotification_ui_manager_browsertest.cc
scheduler
offline_pages
password_manager
password_generation_interactive_uitest.ccpassword_manager_browsertest.ccpassword_manager_interactive_uitest.ccpassword_manager_signin_intercept_test_helper.cc
policy
prefetch
prefetch_proxy
prefs
tracked
profiles
gaia_info_update_service_unittest.ccprofile_attributes_entry.ccprofile_attributes_storage_unittest.ccprofile_info_cache_unittest.cc
renderer_context_menu
safe_browsing
sessions
signin
dice_web_signin_interceptor_browsertest.ccdice_web_signin_interceptor_unittest.ccsignin_global_error_unittest.cc
spellchecker
ssl
sync
test
task_manager
translate
ui
app_list
arc
search
ash
autofill
blocked_content
cocoa
javascript_dialogs
login
media_router
omnibox
passwords
bubble_controllers
save_update_bubble_controller_unittest.ccsave_update_with_account_store_bubble_controller_unittest.cc
manage_passwords_ui_controller_unittest.cctab_sharing
toolbar
views
apps
app_info_dialog
autofill
borealis
certificate_selector_browsertest.ccexternal_protocol_dialog_browsertest.cclocation_bar
media_router
omnibox
page_info
payments
credit_card_editor_view_controller_browsertest.cccvc_unmask_view_controller_browsertest.ccorder_summary_view_controller.ccpayment_credential_enrollment_dialog_view_browsertest.ccpayment_request_browsertest.ccpayment_request_can_make_payment_metrics_browsertest.ccpayment_sheet_view_controller.ccsecure_payment_confirmation_dialog_view_browsertest.ccshipping_address_editor_view_controller.ccshipping_address_editor_view_controller_browsertest.cc
profiles
sharing
supervised_user
tab_sharing
tabs
web_apps
webauthn
web_applications
webui
chromeos
help
management
memories
new_tab_page
settings
signin
welcome
vr
web_applications
components
web_app_data_retriever_unittest.ccweb_app_icon_generator_unittest.ccweb_app_install_utils_unittest.ccweb_app_shortcut_linux_unittest.ccweb_app_shortcut_mac_unittest.mm
extensions
external_web_app_manager_browsertest.ccexternal_web_app_migration_browsertest.ccexternal_web_app_utils_unittest.ccmanifest_update_task_unittest.ccpending_app_manager_impl_unittest.ccpreinstalled_web_apps
system_web_app_manager_unittest.cctest
web_app_install_manager_unittest.ccweb_app_migration_manager_browsertest.cccommon
renderer
test
media_router
chromecast
chromeos
components
diagnostics_ui
local_search_service
content_extraction_utils_unittest.ccinverted_index_search_unittest.ccinverted_index_unittest.cc
public
search_utils_unittest.ccphonehub
message_sender_unittest.ccmutable_phone_model_unittest.ccnotification_manager_impl_unittest.ccphone_status_processor_unittest.cc
string_matching
network
policy
weekly_time
services
components
arc
autofill
content
core
browser
address_normalizer_impl_unittest.ccaddress_rewriter_unittest.ccautofill_download_manager_unittest.ccautofill_profile_validation_util_unittest.ccautofill_profile_validator_unittest.cc
data_model
address_unittest.ccautofill_profile_comparator_unittest.ccautofill_profile_unittest.ccautofill_structured_address_component.ccautofill_structured_address_component_unittest.ccautofill_structured_address_name_unittest.ccautofill_structured_address_utils.ccautofill_structured_address_utils_unittest.ccborrowed_transliterator_unittest.cccontact_info_unittest.cccredit_card.cccredit_card_unittest.cctest_data_creator.cc
field_filler_unittest.ccgeo
payments
personal_data_manager_unittest.ccui
address_contact_form_label_formatter_unittest.ccaddress_email_form_label_formatter_unittest.ccaddress_form_label_formatter_unittest.ccaddress_phone_form_label_formatter_unittest.ccsuggestion_selection_unittest.cc
validation.cccommon
autofill_assistant
bookmarks
drive
exo
filename_generation
history
ntp_snippets
remote
ntp_tiles
offline_pages
core
omnibox
browser
autocomplete_match_type_unittest.ccautocomplete_match_unittest.ccautocomplete_result_unittest.ccdocument_provider.ccdocument_provider_unittest.cchistory_quick_provider_unittest.cchistory_url_provider_unittest.ccin_memory_url_index_types_unittest.ccinline_autocompletion_util_unittest.ccomnibox_edit_model_unittest.ccomnibox_popup_model_unittest.ccon_device_head_provider_unittest.ccsearch_suggestion_parser.ccshortcuts_backend_unittest.ccsuggestion_answer_unittest.cctailored_word_break_iterator_unittest.cctitled_url_match_utils.cctitled_url_match_utils_unittest.cc
password_manager
core
payments
content
policy
core
common
query_parser
search_engines
send_tab_to_self
spellcheck
renderer
storage_monitor
sync_bookmarks
bookmark_model_merger_unittest.ccbookmark_model_observer_impl_unittest.ccbookmark_specifics_conversions_unittest.ccsynced_bookmark_tracker_unittest.cc
sync_sessions
translate
content
android
ios
url_formatter
user_manager
content
browser
accessibility
back_forward_cache_browsertest.ccdownload
file_system_access
loader
network_service_instance_impl.ccnotifications
renderer_host
data_transfer_util.ccnavigation_controller_impl_browsertest.ccrender_frame_proxy_host.ccrender_widget_host_browsertest.ccrender_widget_host_view_aura_unittest.ccrender_widget_host_view_mac_unittest.mm
site_per_process_browsertest.ccsite_per_process_hit_test_browsertest.ccsite_per_process_unload_browsertest.ccsnapshot_browsertest.ccspeech
web_contents
web_package
webui
renderer
device
docs
extensions/browser
ios
chrome
browser
autofill
credential_provider
safe_browsing
search_engines
send_tab_to_self
tabs
ui
web
web
web_view
internal
net/ntlm
remoting/host/chromeos
rlz
services/device/public/cpp/bluetooth
third_party/blink
common
renderer
modules
ui
accessibility
base
gfx
message_center
ozone
platform
wayland
views
controls
textfield
web_dialogs
url
@ -33,7 +33,7 @@ std::unique_ptr<content::NavigationEntry> CreateNavigationEntry() {
|
||||
content::Referrer referrer;
|
||||
referrer.url = GURL("http://referrer_url");
|
||||
referrer.policy = network::mojom::ReferrerPolicy::kOrigin;
|
||||
const std::u16string title(base::UTF8ToUTF16("title"));
|
||||
const std::u16string title(u"title");
|
||||
const bool has_post_data = true;
|
||||
const GURL original_request_url("http://original_request_url");
|
||||
const GURL base_url_for_data_url("http://base_url");
|
||||
@ -182,7 +182,7 @@ TEST_F(AndroidWebViewStateSerializerTest,
|
||||
GURL virtual_url("https://example.com/virtual_url");
|
||||
content::Referrer referrer(GURL("https://example.com/referrer"),
|
||||
network::mojom::ReferrerPolicy::kDefault);
|
||||
std::u16string title = base::UTF8ToUTF16("title");
|
||||
std::u16string title = u"title";
|
||||
std::string empty_encoded_page_state = "";
|
||||
bool has_post_data = false;
|
||||
GURL original_request_url("https://example.com/original");
|
||||
|
@ -462,8 +462,7 @@ TEST_F(AppListControllerImplTest, MAYBE_CloseNotificationWithAppListShown) {
|
||||
message_center::MessageCenter::Get()->AddNotification(
|
||||
std::make_unique<message_center::Notification>(
|
||||
message_center::NOTIFICATION_TYPE_BASE_FORMAT, notification_id,
|
||||
base::UTF8ToUTF16(notification_title),
|
||||
base::UTF8ToUTF16("test message"), gfx::Image(),
|
||||
base::UTF8ToUTF16(notification_title), u"test message", gfx::Image(),
|
||||
std::u16string() /* display_source */, GURL(),
|
||||
message_center::NotifierId(), message_center::RichNotificationData(),
|
||||
new message_center::NotificationDelegate()));
|
||||
|
@ -678,7 +678,7 @@ class AppListViewFocusTest : public views::ViewsTestBase,
|
||||
// Arabic word of "test".
|
||||
? base::UTF8ToUTF16(
|
||||
"\xd8\xa7\xd8\xae\xd8\xaa\xd8\xa8\xd8\xa7\xd8\xb1")
|
||||
: base::UTF8ToUTF16("test");
|
||||
: u"test";
|
||||
textfield->InsertText(
|
||||
text,
|
||||
ui::TextInputClient::InsertTextCursorBehavior::kMoveCursorAfterText);
|
||||
@ -749,7 +749,7 @@ class AppListViewFocusTest : public views::ViewsTestBase,
|
||||
|
||||
// Clean up
|
||||
textfield->RequestFocus();
|
||||
textfield->SetText(base::UTF8ToUTF16(""));
|
||||
textfield->SetText(u"");
|
||||
}
|
||||
|
||||
AppListView* app_list_view() { return view_; }
|
||||
@ -1002,7 +1002,7 @@ TEST_P(AppListViewFocusTest, LeftRightFocusTraversalInHalfState) {
|
||||
// Arabic word of "test".
|
||||
? base::UTF8ToUTF16(
|
||||
"\xd8\xa7\xd8\xae\xd8\xaa\xd8\xa8\xd8\xa7\xd8\xb1")
|
||||
: base::UTF8ToUTF16("test");
|
||||
: u"test";
|
||||
search_box_view()->search_box()->InsertText(
|
||||
text,
|
||||
ui::TextInputClient::InsertTextCursorBehavior::kMoveCursorAfterText);
|
||||
@ -1323,7 +1323,7 @@ TEST_F(AppListViewFocusTest, RedirectFocusToSearchBox) {
|
||||
GetAllSuggestions()[0]->RequestFocus();
|
||||
SimulateKeyPress(ui::VKEY_A, false);
|
||||
EXPECT_EQ(search_box_view()->search_box(), focused_view());
|
||||
EXPECT_EQ(search_box_view()->search_box()->GetText(), base::UTF8ToUTF16("a"));
|
||||
EXPECT_EQ(search_box_view()->search_box()->GetText(), u"a");
|
||||
EXPECT_FALSE(search_box_view()->search_box()->HasSelection());
|
||||
|
||||
// Set focus to close button and type a character.
|
||||
@ -1331,15 +1331,14 @@ TEST_F(AppListViewFocusTest, RedirectFocusToSearchBox) {
|
||||
EXPECT_NE(search_box_view()->search_box(), focused_view());
|
||||
SimulateKeyPress(ui::VKEY_B, false);
|
||||
EXPECT_EQ(search_box_view()->search_box(), focused_view());
|
||||
EXPECT_EQ(search_box_view()->search_box()->GetText(),
|
||||
base::UTF8ToUTF16("ab"));
|
||||
EXPECT_EQ(search_box_view()->search_box()->GetText(), u"ab");
|
||||
EXPECT_FALSE(search_box_view()->search_box()->HasSelection());
|
||||
|
||||
// Set focus to close button and hitting backspace.
|
||||
search_box_view()->close_button()->RequestFocus();
|
||||
SimulateKeyPress(ui::VKEY_BACK, false);
|
||||
EXPECT_EQ(search_box_view()->search_box(), focused_view());
|
||||
EXPECT_EQ(search_box_view()->search_box()->GetText(), base::UTF8ToUTF16("a"));
|
||||
EXPECT_EQ(search_box_view()->search_box()->GetText(), u"a");
|
||||
EXPECT_FALSE(search_box_view()->search_box()->HasSelection());
|
||||
}
|
||||
|
||||
@ -1360,18 +1359,18 @@ TEST_F(AppListViewFocusTest, SearchBoxTextUpdatesOnResultFocus) {
|
||||
// Change focus to the next result
|
||||
SimulateKeyPress(ui::VKEY_TAB, false);
|
||||
|
||||
EXPECT_EQ(search_box->GetText(), base::UTF8ToUTF16("TestResult2"));
|
||||
EXPECT_EQ(search_box->GetText(), u"TestResult2");
|
||||
|
||||
SimulateKeyPress(ui::VKEY_TAB, true);
|
||||
|
||||
EXPECT_EQ(search_box->GetText(), base::UTF8ToUTF16("TestResult1"));
|
||||
EXPECT_EQ(search_box->GetText(), u"TestResult1");
|
||||
|
||||
SimulateKeyPress(ui::VKEY_TAB, false);
|
||||
|
||||
// Change focus to the final result
|
||||
SimulateKeyPress(ui::VKEY_TAB, false);
|
||||
|
||||
EXPECT_EQ(search_box->GetText(), base::UTF8ToUTF16("TestResult3"));
|
||||
EXPECT_EQ(search_box->GetText(), u"TestResult3");
|
||||
}
|
||||
|
||||
// Tests that ctrl-A selects all text in the searchbox when the SearchBoxView is
|
||||
@ -1474,7 +1473,7 @@ TEST_F(AppListViewFocusTest, HittingEnterWhenFocusOnSearchBox) {
|
||||
// Type something in search box to transition to HALF state and populate
|
||||
// fake list results. Then hit Enter key.
|
||||
search_box_view()->search_box()->InsertText(
|
||||
base::UTF8ToUTF16("test"),
|
||||
u"test",
|
||||
ui::TextInputClient::InsertTextCursorBehavior::kMoveCursorAfterText);
|
||||
const int kListResults = 2;
|
||||
SetUpSearchResults(0, kListResults);
|
||||
@ -1775,7 +1774,7 @@ TEST_F(AppListViewTest, TypingPeekingToHalf) {
|
||||
Show();
|
||||
search_box->SetText(std::u16string());
|
||||
search_box->InsertText(
|
||||
base::UTF8ToUTF16("nice"),
|
||||
u"nice",
|
||||
ui::TextInputClient::InsertTextCursorBehavior::kMoveCursorAfterText);
|
||||
|
||||
ASSERT_EQ(ash::AppListViewState::kHalf, view_->app_list_state());
|
||||
@ -1792,7 +1791,7 @@ TEST_F(AppListViewTest, TypingFullscreenToFullscreenSearch) {
|
||||
|
||||
search_box->SetText(std::u16string());
|
||||
search_box->InsertText(
|
||||
base::UTF8ToUTF16("https://youtu.be/dQw4w9WgXcQ"),
|
||||
u"https://youtu.be/dQw4w9WgXcQ",
|
||||
ui::TextInputClient::InsertTextCursorBehavior::kMoveCursorAfterText);
|
||||
|
||||
ASSERT_EQ(ash::AppListViewState::kFullscreenSearch, view_->app_list_state());
|
||||
@ -1807,7 +1806,7 @@ TEST_F(AppListViewTest, TypingTabletModeFullscreenSearch) {
|
||||
Show();
|
||||
search_box->SetText(std::u16string());
|
||||
search_box->InsertText(
|
||||
base::UTF8ToUTF16("cool!"),
|
||||
u"cool!",
|
||||
ui::TextInputClient::InsertTextCursorBehavior::kMoveCursorAfterText);
|
||||
|
||||
ASSERT_EQ(ash::AppListViewState::kFullscreenSearch, view_->app_list_state());
|
||||
@ -2220,7 +2219,7 @@ TEST_F(AppListViewTest, DISABLED_SearchResultsTest) {
|
||||
view_->Layout();
|
||||
EXPECT_TRUE(IsStateShown(ash::AppListState::kStateApps));
|
||||
|
||||
std::u16string search_text = base::UTF8ToUTF16("test");
|
||||
std::u16string search_text = u"test";
|
||||
main_view->search_box_view()->search_box()->SetText(std::u16string());
|
||||
main_view->search_box_view()->search_box()->InsertText(
|
||||
search_text,
|
||||
@ -2241,7 +2240,7 @@ TEST_F(AppListViewTest, DISABLED_SearchResultsTest) {
|
||||
EXPECT_TRUE(CheckSearchBoxWidget(
|
||||
contents_view->GetSearchBoxBounds(ash::AppListState::kStateApps)));
|
||||
|
||||
std::u16string new_search_text = base::UTF8ToUTF16("apple");
|
||||
std::u16string new_search_text = u"apple";
|
||||
main_view->search_box_view()->search_box()->SetText(std::u16string());
|
||||
main_view->search_box_view()->search_box()->InsertText(
|
||||
new_search_text,
|
||||
@ -2296,7 +2295,7 @@ TEST_F(AppListViewTest, DISABLED_BackTest) {
|
||||
EXPECT_EQ(1, delegate_->dismiss_count());
|
||||
|
||||
// Show the search results.
|
||||
std::u16string new_search_text = base::UTF8ToUTF16("apple");
|
||||
std::u16string new_search_text = u"apple";
|
||||
search_box_view->search_box()->SetText(std::u16string());
|
||||
search_box_view->search_box()->InsertText(
|
||||
new_search_text,
|
||||
@ -2407,7 +2406,7 @@ TEST_F(AppListViewTest, BackAction) {
|
||||
// Select the second page and open search results page.
|
||||
apps_grid_view()->pagination_model()->SelectPage(1, false);
|
||||
search_box_view()->search_box()->InsertText(
|
||||
base::UTF8ToUTF16("A"),
|
||||
u"A",
|
||||
ui::TextInputClient::InsertTextCursorBehavior::kMoveCursorAfterText);
|
||||
EXPECT_EQ(ash::AppListViewState::kFullscreenSearch, view_->app_list_state());
|
||||
EXPECT_EQ(1, apps_grid_view()->pagination_model()->selected_page());
|
||||
@ -2485,7 +2484,7 @@ TEST_F(AppListViewFocusTest, ShowEmbeddedAssistantUI) {
|
||||
// Type something in search box to transition to HALF state and populate
|
||||
// fake list results. Then hit Enter key.
|
||||
search_box_view()->search_box()->InsertText(
|
||||
base::UTF8ToUTF16("test"),
|
||||
u"test",
|
||||
ui::TextInputClient::InsertTextCursorBehavior::kMoveCursorAfterText);
|
||||
const int kListResults = 2;
|
||||
const int kIndexOpenAssistantUi = 1;
|
||||
|
@ -837,23 +837,23 @@ TEST_F(AssistantPageViewTest, RememberAndShowHistory) {
|
||||
EXPECT_TRUE(input_text_field()->GetText().empty());
|
||||
|
||||
PressKey(ui::VKEY_UP);
|
||||
EXPECT_EQ(input_text_field()->GetText(), base::UTF8ToUTF16("query 2"));
|
||||
EXPECT_EQ(input_text_field()->GetText(), u"query 2");
|
||||
|
||||
PressKey(ui::VKEY_UP);
|
||||
EXPECT_EQ(input_text_field()->GetText(), base::UTF8ToUTF16("query 1"));
|
||||
EXPECT_EQ(input_text_field()->GetText(), u"query 1");
|
||||
|
||||
PressKey(ui::VKEY_UP);
|
||||
EXPECT_EQ(input_text_field()->GetText(), base::UTF8ToUTF16("query 1"));
|
||||
EXPECT_EQ(input_text_field()->GetText(), u"query 1");
|
||||
|
||||
PressKey(ui::VKEY_DOWN);
|
||||
EXPECT_EQ(input_text_field()->GetText(), base::UTF8ToUTF16("query 2"));
|
||||
EXPECT_EQ(input_text_field()->GetText(), u"query 2");
|
||||
|
||||
PressKey(ui::VKEY_DOWN);
|
||||
EXPECT_TRUE(input_text_field()->GetText().empty());
|
||||
}
|
||||
|
||||
TEST_F(AssistantPageViewTest, ShouldNotClearQueryWhenSwitchingToTabletMode) {
|
||||
const std::u16string query_text = base::UTF8ToUTF16("unsubmitted query");
|
||||
const std::u16string query_text = u"unsubmitted query";
|
||||
ShowAssistantUiInTextMode();
|
||||
input_text_field()->SetText(query_text);
|
||||
|
||||
|
@ -80,7 +80,7 @@ class SearchResultListViewTest : public views::test::WidgetTest {
|
||||
assistant_result->set_result_type(
|
||||
ash::AppListSearchResultType::kAssistantText);
|
||||
assistant_result->set_display_type(ash::SearchResultDisplayType::kList);
|
||||
assistant_result->set_title(base::UTF8ToUTF16("assistant result"));
|
||||
assistant_result->set_title(u"assistant result");
|
||||
results->Add(std::move(assistant_result));
|
||||
|
||||
RunPendingMessages();
|
||||
@ -189,7 +189,7 @@ TEST_F(SearchResultListViewTest, HidesAssistantResultWhenTilesVisible) {
|
||||
// Assistant result should be set and visible.
|
||||
for (const auto* view : GetAssistantResultViews()) {
|
||||
EXPECT_TRUE(view->GetVisible());
|
||||
EXPECT_EQ(view->result()->title(), base::UTF8ToUTF16("assistant result"));
|
||||
EXPECT_EQ(view->result()->title(), u"assistant result");
|
||||
}
|
||||
|
||||
// Add a tile result
|
||||
|
@ -424,8 +424,7 @@ TEST_F(AssistantOnboardingViewTest, ShouldHandleSuggestionUpdates) {
|
||||
// Verify view state is updated to reflect model state.
|
||||
auto suggestion_views = GetOnboardingSuggestionViews();
|
||||
ASSERT_EQ(suggestion_views.size(), 1u);
|
||||
EXPECT_EQ(suggestion_views.at(0)->GetText(),
|
||||
base::UTF8ToUTF16("Forced suggestion"));
|
||||
EXPECT_EQ(suggestion_views.at(0)->GetText(), u"Forced suggestion");
|
||||
}
|
||||
|
||||
TEST_F(AssistantOnboardingViewTest, ShouldHandleLocalIcons) {
|
||||
|
@ -105,12 +105,12 @@ std::u16string GetLabelForCustomData(const ui::ClipboardData& data) {
|
||||
|
||||
// Strip path information, so all that's left are file names.
|
||||
for (auto it = source_list.begin(); it != source_list.end(); ++it)
|
||||
*it = it->substr(it->find_last_of(base::UTF8ToUTF16("/")) + 1);
|
||||
*it = it->substr(it->find_last_of(u"/") + 1);
|
||||
|
||||
// Join file names, unescaping encoded character sequences for display. This
|
||||
// ensures that "My%20File.txt" will display as "My File.txt".
|
||||
return base::UTF8ToUTF16(base::UnescapeURLComponent(
|
||||
base::UTF16ToUTF8(base::JoinString(source_list, base::UTF8ToUTF16(", "))),
|
||||
base::UTF16ToUTF8(base::JoinString(source_list, u", ")),
|
||||
base::UnescapeRule::SPACES));
|
||||
}
|
||||
|
||||
|
@ -135,60 +135,53 @@ TEST_F(ClipboardHistoryResourceManagerTest, GetLabel) {
|
||||
.SetWebSmartPaste(true);
|
||||
|
||||
// Bitmap data always take precedence.
|
||||
EXPECT_EQ(resource_manager()->GetLabel(builder.Build()),
|
||||
base::UTF8ToUTF16("Image"));
|
||||
EXPECT_EQ(resource_manager()->GetLabel(builder.Build()), u"Image");
|
||||
|
||||
builder.ClearBitmap();
|
||||
|
||||
// In the absence of bitmap data, HTML data takes precedence, but we use
|
||||
// plain-text format for the label.
|
||||
EXPECT_EQ(resource_manager()->GetLabel(builder.Build()),
|
||||
base::UTF8ToUTF16("Text"));
|
||||
EXPECT_EQ(resource_manager()->GetLabel(builder.Build()), u"Text");
|
||||
|
||||
builder.ClearText();
|
||||
|
||||
// If plan-text does not exist, we show a placeholder label.
|
||||
EXPECT_EQ(resource_manager()->GetLabel(builder.Build()),
|
||||
base::UTF8ToUTF16("HTML Content"));
|
||||
EXPECT_EQ(resource_manager()->GetLabel(builder.Build()), u"HTML Content");
|
||||
|
||||
builder.SetText("Text");
|
||||
|
||||
builder.ClearMarkup();
|
||||
|
||||
// In the absence of markup data, text data takes precedence.
|
||||
EXPECT_EQ(resource_manager()->GetLabel(builder.Build()),
|
||||
base::UTF8ToUTF16("Text"));
|
||||
EXPECT_EQ(resource_manager()->GetLabel(builder.Build()), u"Text");
|
||||
|
||||
builder.ClearText();
|
||||
|
||||
// In the absence of HTML data, RTF data takes precedence.
|
||||
EXPECT_EQ(resource_manager()->GetLabel(builder.Build()),
|
||||
base::UTF8ToUTF16("RTF Content"));
|
||||
EXPECT_EQ(resource_manager()->GetLabel(builder.Build()), u"RTF Content");
|
||||
|
||||
builder.ClearRtf();
|
||||
|
||||
// In the absence of RTF data, Filenames data takes precedence.
|
||||
EXPECT_EQ(resource_manager()->GetLabel(builder.Build()),
|
||||
base::UTF8ToUTF16("filename"));
|
||||
EXPECT_EQ(resource_manager()->GetLabel(builder.Build()), u"filename");
|
||||
|
||||
builder.ClearFilenames();
|
||||
|
||||
// In the absence of RTF data, bookmark data takes precedence.
|
||||
EXPECT_EQ(resource_manager()->GetLabel(builder.Build()),
|
||||
base::UTF8ToUTF16("Bookmark Title"));
|
||||
EXPECT_EQ(resource_manager()->GetLabel(builder.Build()), u"Bookmark Title");
|
||||
|
||||
builder.ClearBookmarkTitle();
|
||||
|
||||
// In the absence of bookmark data, web smart paste data takes precedence.
|
||||
EXPECT_EQ(resource_manager()->GetLabel(builder.Build()),
|
||||
base::UTF8ToUTF16("Web Smart Paste Content"));
|
||||
u"Web Smart Paste Content");
|
||||
|
||||
builder.ClearWebSmartPaste();
|
||||
|
||||
// In the absence of web smart paste data, file system data takes precedence.
|
||||
// NOTE: File system data is the only kind of custom data currently supported.
|
||||
EXPECT_EQ(resource_manager()->GetLabel(builder.Build()),
|
||||
base::UTF8ToUTF16("File.txt, Other File.txt"));
|
||||
u"File.txt, Other File.txt");
|
||||
}
|
||||
|
||||
// Tests that Render is called once when an eligible <img> is added
|
||||
@ -206,7 +199,7 @@ TEST_F(ClipboardHistoryResourceManagerTest, BasicImgCachedImageModel) {
|
||||
// Write a basic ClipboardData which is eligible to render HTML.
|
||||
{
|
||||
ui::ScopedClipboardWriter scw(ui::ClipboardBuffer::kCopyPaste);
|
||||
scw.WriteHTML(base::UTF8ToUTF16("<img test>"), "source_url");
|
||||
scw.WriteHTML(u"<img test>", "source_url");
|
||||
}
|
||||
|
||||
FlushMessageLoop();
|
||||
@ -230,7 +223,7 @@ TEST_F(ClipboardHistoryResourceManagerTest, BasicTableCachedImageModel) {
|
||||
// Write a basic ClipboardData which is eligible to render HTML.
|
||||
{
|
||||
ui::ScopedClipboardWriter scw(ui::ClipboardBuffer::kCopyPaste);
|
||||
scw.WriteHTML(base::UTF8ToUTF16("<table test>"), "source_url");
|
||||
scw.WriteHTML(u"<table test>", "source_url");
|
||||
}
|
||||
|
||||
FlushMessageLoop();
|
||||
@ -254,8 +247,7 @@ TEST_F(ClipboardHistoryResourceManagerTest, BasicIneligibleCachedImageModel) {
|
||||
// Write a basic ClipboardData which is eligible to render HTML.
|
||||
{
|
||||
ui::ScopedClipboardWriter scw(ui::ClipboardBuffer::kCopyPaste);
|
||||
scw.WriteHTML(base::UTF8ToUTF16("html with no img or table tag"),
|
||||
"source_url");
|
||||
scw.WriteHTML(u"html with no img or table tag", "source_url");
|
||||
}
|
||||
|
||||
FlushMessageLoop();
|
||||
@ -279,12 +271,12 @@ TEST_F(ClipboardHistoryResourceManagerTest, DuplicateHTML) {
|
||||
// to the clipboard history.
|
||||
{
|
||||
ui::ScopedClipboardWriter scw(ui::ClipboardBuffer::kCopyPaste);
|
||||
scw.WriteHTML(base::UTF8ToUTF16("<img test>"), "source_url_1");
|
||||
scw.WriteHTML(u"<img test>", "source_url_1");
|
||||
}
|
||||
FlushMessageLoop();
|
||||
{
|
||||
ui::ScopedClipboardWriter scw(ui::ClipboardBuffer::kCopyPaste);
|
||||
scw.WriteHTML(base::UTF8ToUTF16("<img test>"), "source_url_2");
|
||||
scw.WriteHTML(u"<img test>", "source_url_2");
|
||||
}
|
||||
FlushMessageLoop();
|
||||
|
||||
@ -312,12 +304,12 @@ TEST_F(ClipboardHistoryResourceManagerTest, DifferentHTML) {
|
||||
EXPECT_CALL(*mock_image_factory(), CancelRequest).Times(0);
|
||||
{
|
||||
ui::ScopedClipboardWriter scw(ui::ClipboardBuffer::kCopyPaste);
|
||||
scw.WriteHTML(base::UTF8ToUTF16("<img test>"), "source_url");
|
||||
scw.WriteHTML(u"<img test>", "source_url");
|
||||
}
|
||||
FlushMessageLoop();
|
||||
{
|
||||
ui::ScopedClipboardWriter scw(ui::ClipboardBuffer::kCopyPaste);
|
||||
scw.WriteHTML(base::UTF8ToUTF16("<img different>"), "source_url");
|
||||
scw.WriteHTML(u"<img different>", "source_url");
|
||||
}
|
||||
FlushMessageLoop();
|
||||
|
||||
@ -338,7 +330,7 @@ TEST_F(ClipboardHistoryResourceManagerTest, IneligibleItem) {
|
||||
EXPECT_CALL(*mock_image_factory(), CancelRequest).Times(0);
|
||||
{
|
||||
ui::ScopedClipboardWriter scw(ui::ClipboardBuffer::kCopyPaste);
|
||||
scw.WriteHTML(base::UTF8ToUTF16("test"), "source_url");
|
||||
scw.WriteHTML(u"test", "source_url");
|
||||
scw.WriteImage(GetRandomBitmap());
|
||||
}
|
||||
FlushMessageLoop();
|
||||
@ -350,11 +342,11 @@ TEST_F(ClipboardHistoryResourceManagerTest, IneligibleItem) {
|
||||
{
|
||||
ui::ScopedClipboardWriter scw(ui::ClipboardBuffer::kCopyPaste);
|
||||
|
||||
scw.WriteText(base::UTF8ToUTF16("test"));
|
||||
scw.WriteText(u"test");
|
||||
|
||||
scw.WriteRTF("rtf");
|
||||
|
||||
scw.WriteBookmark(base::UTF8ToUTF16("bookmark_title"), "test_url");
|
||||
scw.WriteBookmark(u"bookmark_title", "test_url");
|
||||
}
|
||||
FlushMessageLoop();
|
||||
|
||||
|
@ -162,7 +162,7 @@ TEST_F(ClipboardHistoryTest, NothingCopiedNothingSaved) {
|
||||
|
||||
// Tests that if one thing is copied, one thing is saved.
|
||||
TEST_F(ClipboardHistoryTest, OneThingCopiedOneThingSaved) {
|
||||
std::vector<std::u16string> input_strings{base::UTF8ToUTF16("test")};
|
||||
std::vector<std::u16string> input_strings{u"test"};
|
||||
std::vector<std::u16string> expected_strings = input_strings;
|
||||
|
||||
// Test that only one string is in history.
|
||||
@ -172,9 +172,8 @@ TEST_F(ClipboardHistoryTest, OneThingCopiedOneThingSaved) {
|
||||
// Tests that if the same (non bitmap) thing is copied, only one of the
|
||||
// duplicates is in the list.
|
||||
TEST_F(ClipboardHistoryTest, DuplicateBasic) {
|
||||
std::vector<std::u16string> input_strings{base::UTF8ToUTF16("test"),
|
||||
base::UTF8ToUTF16("test")};
|
||||
std::vector<std::u16string> expected_strings{base::UTF8ToUTF16("test")};
|
||||
std::vector<std::u16string> input_strings{u"test", u"test"};
|
||||
std::vector<std::u16string> expected_strings{u"test"};
|
||||
|
||||
// Test that both things are saved.
|
||||
WriteAndEnsureTextHistory(input_strings, expected_strings);
|
||||
@ -183,12 +182,10 @@ TEST_F(ClipboardHistoryTest, DuplicateBasic) {
|
||||
// Tests that if multiple things are copied in the same task sequence, only the
|
||||
// most recent thing is saved.
|
||||
TEST_F(ClipboardHistoryTest, InSameSequenceBasic) {
|
||||
std::vector<std::u16string> input_strings{base::UTF8ToUTF16("test1"),
|
||||
base::UTF8ToUTF16("test2"),
|
||||
base::UTF8ToUTF16("test3")};
|
||||
std::vector<std::u16string> input_strings{u"test1", u"test2", u"test3"};
|
||||
// Because |input_strings| will be copied in the same task sequence, history
|
||||
// should only retain the most recent thing.
|
||||
std::vector<std::u16string> expected_strings{base::UTF8ToUTF16("test3")};
|
||||
std::vector<std::u16string> expected_strings{u"test3"};
|
||||
|
||||
// Test that only the most recent thing is saved.
|
||||
WriteAndEnsureTextHistory(input_strings, expected_strings,
|
||||
@ -197,9 +194,8 @@ TEST_F(ClipboardHistoryTest, InSameSequenceBasic) {
|
||||
|
||||
// Tests the ordering of history is in reverse chronological order.
|
||||
TEST_F(ClipboardHistoryTest, HistoryIsReverseChronological) {
|
||||
std::vector<std::u16string> input_strings{
|
||||
base::UTF8ToUTF16("test1"), base::UTF8ToUTF16("test2"),
|
||||
base::UTF8ToUTF16("test3"), base::UTF8ToUTF16("test4")};
|
||||
std::vector<std::u16string> input_strings{u"test1", u"test2", u"test3",
|
||||
u"test4"};
|
||||
std::vector<std::u16string> expected_strings = input_strings;
|
||||
// Reverse the vector, history should match this ordering.
|
||||
std::reverse(std::begin(expected_strings), std::end(expected_strings));
|
||||
@ -210,15 +206,12 @@ TEST_F(ClipboardHistoryTest, HistoryIsReverseChronological) {
|
||||
// to the front of the clipboard history.
|
||||
TEST_F(ClipboardHistoryTest, DuplicatePrecedesPreviousRecord) {
|
||||
// Input holds a unique string sandwiched by a copy.
|
||||
std::vector<std::u16string> input_strings{
|
||||
base::UTF8ToUTF16("test1"), base::UTF8ToUTF16("test2"),
|
||||
base::UTF8ToUTF16("test1"), base::UTF8ToUTF16("test3")};
|
||||
std::vector<std::u16string> input_strings{u"test1", u"test2", u"test1",
|
||||
u"test3"};
|
||||
// The result should be a reversal of the copied elements. When a duplicate
|
||||
// is copied, history will have that item moved to the front instead of adding
|
||||
// a new item.
|
||||
std::vector<std::u16string> expected_strings{base::UTF8ToUTF16("test3"),
|
||||
base::UTF8ToUTF16("test1"),
|
||||
base::UTF8ToUTF16("test2")};
|
||||
std::vector<std::u16string> expected_strings{u"test3", u"test1", u"test2"};
|
||||
|
||||
WriteAndEnsureTextHistory(input_strings, expected_strings);
|
||||
}
|
||||
@ -226,9 +219,7 @@ TEST_F(ClipboardHistoryTest, DuplicatePrecedesPreviousRecord) {
|
||||
// Tests that nothing is saved after history is cleared.
|
||||
TEST_F(ClipboardHistoryTest, ClearHistoryBasic) {
|
||||
// Input holds a unique string sandwhiched by a copy.
|
||||
std::vector<std::u16string> input_strings{base::UTF8ToUTF16("test1"),
|
||||
base::UTF8ToUTF16("test2"),
|
||||
base::UTF8ToUTF16("test1")};
|
||||
std::vector<std::u16string> input_strings{u"test1", u"test2", u"test1"};
|
||||
// The result should be a reversal of the last two elements. When a duplicate
|
||||
// is copied, history will show the most recent version of that duplicate.
|
||||
std::vector<std::u16string> expected_strings{};
|
||||
@ -250,11 +241,9 @@ TEST_F(ClipboardHistoryTest, ClearHistoryFromClipboardNoHistory) {
|
||||
|
||||
// Tests that clipboard history is cleared when the clipboard is cleared.
|
||||
TEST_F(ClipboardHistoryTest, ClearHistoryFromClipboardWithHistory) {
|
||||
std::vector<std::u16string> input_strings{base::UTF8ToUTF16("test1"),
|
||||
base::UTF8ToUTF16("test2")};
|
||||
std::vector<std::u16string> input_strings{u"test1", u"test2"};
|
||||
|
||||
std::vector<std::u16string> expected_strings_before_clear{
|
||||
base::UTF8ToUTF16("test2"), base::UTF8ToUTF16("test1")};
|
||||
std::vector<std::u16string> expected_strings_before_clear{u"test2", u"test1"};
|
||||
std::vector<std::u16string> expected_strings_after_clear{};
|
||||
|
||||
for (const auto& input_string : input_strings) {
|
||||
@ -274,10 +263,8 @@ TEST_F(ClipboardHistoryTest, ClearHistoryFromClipboardWithHistory) {
|
||||
|
||||
// Tests that the limit of clipboard history is respected.
|
||||
TEST_F(ClipboardHistoryTest, HistoryLimit) {
|
||||
std::vector<std::u16string> input_strings{
|
||||
base::UTF8ToUTF16("test1"), base::UTF8ToUTF16("test2"),
|
||||
base::UTF8ToUTF16("test3"), base::UTF8ToUTF16("test4"),
|
||||
base::UTF8ToUTF16("test5"), base::UTF8ToUTF16("test6")};
|
||||
std::vector<std::u16string> input_strings{u"test1", u"test2", u"test3",
|
||||
u"test4", u"test5", u"test6"};
|
||||
|
||||
// The result should be a reversal of the last five elements.
|
||||
std::vector<std::u16string> expected_strings{input_strings.begin() + 1,
|
||||
@ -288,9 +275,7 @@ TEST_F(ClipboardHistoryTest, HistoryLimit) {
|
||||
|
||||
// Tests that pausing clipboard history results in no history collected.
|
||||
TEST_F(ClipboardHistoryTest, PauseHistory) {
|
||||
std::vector<std::u16string> input_strings{base::UTF8ToUTF16("test1"),
|
||||
base::UTF8ToUTF16("test2"),
|
||||
base::UTF8ToUTF16("test1")};
|
||||
std::vector<std::u16string> input_strings{u"test1", u"test2", u"test1"};
|
||||
// Because history is paused, there should be nothing stored.
|
||||
std::vector<std::u16string> expected_strings{};
|
||||
|
||||
@ -328,10 +313,8 @@ TEST_F(ClipboardHistoryTest, DuplicateBitmap) {
|
||||
// Tests that unrecognized custom data is omitted from clipboard history.
|
||||
TEST_F(ClipboardHistoryTest, BasicCustomData) {
|
||||
const std::unordered_map<std::u16string, std::u16string> input_data = {
|
||||
{base::UTF8ToUTF16("custom-format-1"),
|
||||
base::UTF8ToUTF16("custom-data-1")},
|
||||
{base::UTF8ToUTF16("custom-format-2"),
|
||||
base::UTF8ToUTF16("custom-data-2")}};
|
||||
{u"custom-format-1", u"custom-data-1"},
|
||||
{u"custom-format-2", u"custom-data-2"}};
|
||||
|
||||
// Custom data which is not recognized is omitted from history.
|
||||
WriteAndEnsureCustomDataHistory(input_data, /*expected_data=*/{});
|
||||
@ -340,8 +323,7 @@ TEST_F(ClipboardHistoryTest, BasicCustomData) {
|
||||
// Tests that file system data is recorded in clipboard history.
|
||||
TEST_F(ClipboardHistoryTest, BasicFileSystemData) {
|
||||
const std::unordered_map<std::u16string, std::u16string> input_data = {
|
||||
{base::UTF8ToUTF16("fs/sources"),
|
||||
base::UTF8ToUTF16("/path/to/My%20File.txt")}};
|
||||
{u"fs/sources", u"/path/to/My%20File.txt"}};
|
||||
|
||||
const std::unordered_map<std::u16string, std::u16string> expected_data =
|
||||
input_data;
|
||||
|
@ -100,7 +100,7 @@ TEST_F(ClipboardHistoryUtilTest, GetFileSystemSources) {
|
||||
|
||||
builder.SetFileSystemData({"/path/to/My%20File.txt"});
|
||||
EXPECT_EQ(GetFileSystemSources(builder.Build().data()),
|
||||
base::UTF8ToUTF16("/path/to/My%20File.txt"));
|
||||
u"/path/to/My%20File.txt");
|
||||
}
|
||||
|
||||
TEST_F(ClipboardHistoryUtilTest, GetSplitFileSystemData) {
|
||||
|
@ -91,12 +91,12 @@ TEST_F(DisplayUtilTest, RotatedDisplay) {
|
||||
|
||||
TEST_F(DisplayUtilTest, ConvertRefreshRateToString16) {
|
||||
// Decimal numbers are rounded to two digits.
|
||||
EXPECT_EQ(base::UTF8ToUTF16("65.98"), ConvertRefreshRateToString16(65.98379));
|
||||
EXPECT_EQ(base::UTF8ToUTF16("65.99"), ConvertRefreshRateToString16(65.98779));
|
||||
EXPECT_EQ(u"65.98", ConvertRefreshRateToString16(65.98379));
|
||||
EXPECT_EQ(u"65.99", ConvertRefreshRateToString16(65.98779));
|
||||
|
||||
// Mantissa is removed for whole numbers.
|
||||
EXPECT_EQ(base::UTF8ToUTF16("58"), ConvertRefreshRateToString16(58.00000));
|
||||
EXPECT_EQ(base::UTF8ToUTF16("58"), ConvertRefreshRateToString16(57.99999));
|
||||
EXPECT_EQ(u"58", ConvertRefreshRateToString16(58.00000));
|
||||
EXPECT_EQ(u"58", ConvertRefreshRateToString16(57.99999));
|
||||
}
|
||||
|
||||
} // namespace ash
|
||||
|
@ -95,7 +95,7 @@ class DragTestView : public views::View {
|
||||
}
|
||||
|
||||
void WriteDragData(const gfx::Point& p, OSExchangeData* data) override {
|
||||
data->SetString(base::UTF8ToUTF16("I am being dragged"));
|
||||
data->SetString(u"I am being dragged");
|
||||
gfx::ImageSkiaRep image_rep(gfx::Size(10, 20), 1.0f);
|
||||
gfx::ImageSkia image_skia(image_rep);
|
||||
data->provider().SetDragImage(image_skia, gfx::Vector2d());
|
||||
@ -425,8 +425,7 @@ class DragDropControllerTest : public AshTestBase {
|
||||
|
||||
void UpdateDragData() {
|
||||
drag_drop_controller_->drag_data_ = std::make_unique<ui::OSExchangeData>();
|
||||
drag_drop_controller_->drag_data_->SetString(
|
||||
base::UTF8ToUTF16("I am being dragged"));
|
||||
drag_drop_controller_->drag_data_->SetString(u"I am being dragged");
|
||||
}
|
||||
|
||||
aura::Window* GetDragWindow() { return drag_drop_controller_->drag_window_; }
|
||||
@ -512,8 +511,7 @@ TEST_F(DragDropControllerTest, DragDropInSingleViewTest) {
|
||||
EXPECT_EQ(num_drags - 1 - drag_view->VerticalDragThreshold(),
|
||||
drag_drop_controller_->num_drag_updates_);
|
||||
EXPECT_TRUE(drag_drop_controller_->drop_received_);
|
||||
EXPECT_EQ(base::UTF8ToUTF16("I am being dragged"),
|
||||
drag_drop_controller_->drag_string_);
|
||||
EXPECT_EQ(u"I am being dragged", drag_drop_controller_->drag_string_);
|
||||
|
||||
EXPECT_EQ(1, drag_view->num_drag_enters_);
|
||||
EXPECT_EQ(num_drags - 1 - drag_view->VerticalDragThreshold(),
|
||||
@ -591,8 +589,7 @@ TEST_F(DragDropControllerTest, DragDropInMultipleViewsSingleWidgetTest) {
|
||||
EXPECT_EQ(num_drags - 1 - drag_view1->HorizontalDragThreshold(),
|
||||
drag_drop_controller_->num_drag_updates_);
|
||||
EXPECT_TRUE(drag_drop_controller_->drop_received_);
|
||||
EXPECT_EQ(base::UTF8ToUTF16("I am being dragged"),
|
||||
drag_drop_controller_->drag_string_);
|
||||
EXPECT_EQ(u"I am being dragged", drag_drop_controller_->drag_string_);
|
||||
|
||||
EXPECT_EQ(1, drag_view1->num_drag_enters_);
|
||||
int num_expected_updates =
|
||||
@ -648,8 +645,7 @@ TEST_F(DragDropControllerTest, DragDropInMultipleViewsMultipleWidgetsTest) {
|
||||
EXPECT_EQ(num_drags - 1 - drag_view1->HorizontalDragThreshold(),
|
||||
drag_drop_controller_->num_drag_updates_);
|
||||
EXPECT_TRUE(drag_drop_controller_->drop_received_);
|
||||
EXPECT_EQ(base::UTF8ToUTF16("I am being dragged"),
|
||||
drag_drop_controller_->drag_string_);
|
||||
EXPECT_EQ(u"I am being dragged", drag_drop_controller_->drag_string_);
|
||||
|
||||
EXPECT_EQ(1, drag_view1->num_drag_enters_);
|
||||
int num_expected_updates =
|
||||
@ -708,8 +704,7 @@ TEST_F(DragDropControllerTest, ViewRemovedWhileInDragDropTest) {
|
||||
EXPECT_EQ(num_drags_1 + num_drags_2 - 1 - drag_view->VerticalDragThreshold(),
|
||||
drag_drop_controller_->num_drag_updates_);
|
||||
EXPECT_TRUE(drag_drop_controller_->drop_received_);
|
||||
EXPECT_EQ(base::UTF8ToUTF16("I am being dragged"),
|
||||
drag_drop_controller_->drag_string_);
|
||||
EXPECT_EQ(u"I am being dragged", drag_drop_controller_->drag_string_);
|
||||
|
||||
EXPECT_EQ(1, drag_view->num_drag_enters_);
|
||||
EXPECT_EQ(num_drags_1 - 1 - drag_view->VerticalDragThreshold(),
|
||||
@ -837,8 +832,7 @@ TEST_F(DragDropControllerTest, SyntheticEventsDuringDragDrop) {
|
||||
EXPECT_EQ(num_drags - 1 - drag_view->VerticalDragThreshold(),
|
||||
drag_drop_controller_->num_drag_updates_);
|
||||
EXPECT_TRUE(drag_drop_controller_->drop_received_);
|
||||
EXPECT_EQ(base::UTF8ToUTF16("I am being dragged"),
|
||||
drag_drop_controller_->drag_string_);
|
||||
EXPECT_EQ(u"I am being dragged", drag_drop_controller_->drag_string_);
|
||||
|
||||
EXPECT_EQ(1, drag_view->num_drag_enters_);
|
||||
EXPECT_EQ(num_drags - 1 - drag_view->VerticalDragThreshold(),
|
||||
@ -877,8 +871,7 @@ TEST_F(DragDropControllerTest, PressingEscapeCancelsDragDrop) {
|
||||
drag_drop_controller_->num_drag_updates_);
|
||||
EXPECT_FALSE(drag_drop_controller_->drop_received_);
|
||||
EXPECT_TRUE(drag_drop_controller_->drag_canceled_);
|
||||
EXPECT_EQ(base::UTF8ToUTF16("I am being dragged"),
|
||||
drag_drop_controller_->drag_string_);
|
||||
EXPECT_EQ(u"I am being dragged", drag_drop_controller_->drag_string_);
|
||||
|
||||
EXPECT_EQ(1, drag_view->num_drag_enters_);
|
||||
EXPECT_EQ(num_drags - 1 - drag_view->VerticalDragThreshold(),
|
||||
@ -923,8 +916,7 @@ TEST_F(DragDropControllerTest, CaptureLostCancelsDragDrop) {
|
||||
drag_drop_controller_->num_drag_updates_);
|
||||
EXPECT_FALSE(drag_drop_controller_->drop_received_);
|
||||
EXPECT_TRUE(drag_drop_controller_->drag_canceled_);
|
||||
EXPECT_EQ(base::UTF8ToUTF16("I am being dragged"),
|
||||
drag_drop_controller_->drag_string_);
|
||||
EXPECT_EQ(u"I am being dragged", drag_drop_controller_->drag_string_);
|
||||
|
||||
EXPECT_EQ(1, drag_view->num_drag_enters_);
|
||||
EXPECT_EQ(num_drags - 1 - drag_view->VerticalDragThreshold(),
|
||||
@ -974,8 +966,7 @@ TEST_F(DragDropControllerTest, TouchDragDropInMultipleWindows) {
|
||||
EXPECT_TRUE(drag_drop_controller_->drag_start_received_);
|
||||
EXPECT_EQ(num_drags, drag_drop_controller_->num_drag_updates_);
|
||||
EXPECT_TRUE(drag_drop_controller_->drop_received_);
|
||||
EXPECT_EQ(base::UTF8ToUTF16("I am being dragged"),
|
||||
drag_drop_controller_->drag_string_);
|
||||
EXPECT_EQ(u"I am being dragged", drag_drop_controller_->drag_string_);
|
||||
|
||||
EXPECT_EQ(1, drag_view1->num_drag_enters_);
|
||||
int num_expected_updates =
|
||||
@ -1011,8 +1002,7 @@ TEST_F(DragDropControllerTest, TouchDragDropCancelsOnLongTap) {
|
||||
EXPECT_TRUE(drag_drop_controller_->drag_canceled_);
|
||||
EXPECT_EQ(0, drag_drop_controller_->num_drag_updates_);
|
||||
EXPECT_FALSE(drag_drop_controller_->drop_received_);
|
||||
EXPECT_EQ(base::UTF8ToUTF16("I am being dragged"),
|
||||
drag_drop_controller_->drag_string_);
|
||||
EXPECT_EQ(u"I am being dragged", drag_drop_controller_->drag_string_);
|
||||
EXPECT_EQ(0, drag_view->num_drag_enters_);
|
||||
EXPECT_EQ(0, drag_view->num_drops_);
|
||||
EXPECT_EQ(0, drag_view->num_drag_exits_);
|
||||
@ -1092,8 +1082,7 @@ TEST_F(DragDropControllerTest, DragDropWithChangingIcon) {
|
||||
EXPECT_EQ(num_drags - 1 - drag_view1->HorizontalDragThreshold(),
|
||||
drag_drop_controller_->num_drag_updates_);
|
||||
EXPECT_TRUE(drag_drop_controller_->drop_received_);
|
||||
EXPECT_EQ(base::UTF8ToUTF16("I am being dragged"),
|
||||
drag_drop_controller_->drag_string_);
|
||||
EXPECT_EQ(u"I am being dragged", drag_drop_controller_->drag_string_);
|
||||
|
||||
EXPECT_EQ(1, drag_view1->num_drag_enters_);
|
||||
int num_expected_updates =
|
||||
@ -1142,7 +1131,7 @@ TEST_F(DragDropControllerTest, DragCancelAcrossDisplays) {
|
||||
|
||||
{
|
||||
auto data(std::make_unique<ui::OSExchangeData>());
|
||||
data->SetString(base::UTF8ToUTF16("I am being dragged"));
|
||||
data->SetString(u"I am being dragged");
|
||||
std::unique_ptr<views::Widget> widget = CreateFramelessWidget();
|
||||
aura::Window* window = widget->GetNativeWindow();
|
||||
drag_drop_controller_->StartDragAndDrop(
|
||||
@ -1176,7 +1165,7 @@ TEST_F(DragDropControllerTest, DragCancelAcrossDisplays) {
|
||||
|
||||
{
|
||||
auto data(std::make_unique<ui::OSExchangeData>());
|
||||
data->SetString(base::UTF8ToUTF16("I am being dragged"));
|
||||
data->SetString(u"I am being dragged");
|
||||
std::unique_ptr<views::Widget> widget = CreateFramelessWidget();
|
||||
aura::Window* window = widget->GetNativeWindow();
|
||||
drag_drop_controller_->StartDragAndDrop(
|
||||
@ -1220,7 +1209,7 @@ TEST_F(DragDropControllerTest, DragCancelOnDisplayDisconnect) {
|
||||
}
|
||||
|
||||
auto data(std::make_unique<ui::OSExchangeData>());
|
||||
data->SetString(base::UTF8ToUTF16("I am being dragged"));
|
||||
data->SetString(u"I am being dragged");
|
||||
std::unique_ptr<views::Widget> widget = CreateFramelessWidget();
|
||||
aura::Window* window = widget->GetNativeWindow();
|
||||
drag_drop_controller_->StartDragAndDrop(
|
||||
@ -1290,8 +1279,7 @@ TEST_F(DragDropControllerTest, TouchDragDropCompletesOnFling) {
|
||||
EXPECT_FALSE(drag_drop_controller_->drag_canceled_);
|
||||
EXPECT_EQ(2, drag_drop_controller_->num_drag_updates_);
|
||||
EXPECT_TRUE(drag_drop_controller_->drop_received_);
|
||||
EXPECT_EQ(base::UTF8ToUTF16("I am being dragged"),
|
||||
drag_drop_controller_->drag_string_);
|
||||
EXPECT_EQ(u"I am being dragged", drag_drop_controller_->drag_string_);
|
||||
EXPECT_EQ(1, drag_view->num_drag_enters_);
|
||||
EXPECT_EQ(2, drag_view->num_drag_updates_);
|
||||
EXPECT_EQ(1, drag_view->num_drops_);
|
||||
@ -1305,7 +1293,7 @@ TEST_F(DragDropControllerTest, DragObserverEvents) {
|
||||
|
||||
{
|
||||
auto data(std::make_unique<ui::OSExchangeData>());
|
||||
data->SetString(base::UTF8ToUTF16("I am being dragged"));
|
||||
data->SetString(u"I am being dragged");
|
||||
ui::OSExchangeData* data_ptr = data.get();
|
||||
|
||||
std::unique_ptr<views::Widget> widget = CreateFramelessWidget();
|
||||
@ -1348,7 +1336,7 @@ TEST_F(DragDropControllerTest, SetEnabled) {
|
||||
|
||||
// Data for the drag.
|
||||
auto data(std::make_unique<ui::OSExchangeData>());
|
||||
data->SetString(base::UTF8ToUTF16("I am being dragged"));
|
||||
data->SetString(u"I am being dragged");
|
||||
std::unique_ptr<views::Widget> widget = CreateFramelessWidget();
|
||||
aura::Window* window = widget->GetNativeWindow();
|
||||
|
||||
@ -1387,7 +1375,7 @@ TEST_F(DragDropControllerTest, EventTarget) {
|
||||
|
||||
drag_drop_controller_->set_should_block_during_drag_drop(true);
|
||||
auto data(std::make_unique<ui::OSExchangeData>());
|
||||
data->SetString(base::UTF8ToUTF16("I am being dragged"));
|
||||
data->SetString(u"I am being dragged");
|
||||
drag_drop_controller_->StartDragAndDrop(
|
||||
std::move(data), window->GetRootWindow(), window.get(), gfx::Point(5, 5),
|
||||
ui::DragDropTypes::DRAG_MOVE, ui::mojom::DragEventSource::kMouse);
|
||||
@ -1543,7 +1531,7 @@ TEST_F(DragDropControllerTest, DlpAllowDragDrop) {
|
||||
generator.PressLeftButton();
|
||||
|
||||
auto data(std::make_unique<ui::OSExchangeData>());
|
||||
data->SetString(base::UTF8ToUTF16("I am being dragged"));
|
||||
data->SetString(u"I am being dragged");
|
||||
|
||||
// Drag update.
|
||||
EXPECT_CALL(dlp_contoller, IsDragDropAllowed(_, _, /*is_drop=*/false))
|
||||
@ -1581,7 +1569,7 @@ TEST_F(DragDropControllerTest, DlpDisallowDragDrop) {
|
||||
generator.PressLeftButton();
|
||||
|
||||
auto data(std::make_unique<ui::OSExchangeData>());
|
||||
data->SetString(base::UTF8ToUTF16("I am being dragged"));
|
||||
data->SetString(u"I am being dragged");
|
||||
|
||||
// Drag update.
|
||||
EXPECT_CALL(dlp_contoller, IsDragDropAllowed(_, _, /*is_drop=*/false))
|
||||
|
@ -34,7 +34,7 @@ class DraggableView : public views::View {
|
||||
}
|
||||
void WriteDragData(const gfx::Point& press_pt,
|
||||
OSExchangeData* data) override {
|
||||
data->SetString(base::UTF8ToUTF16("test"));
|
||||
data->SetString(u"test");
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -651,7 +651,7 @@ LockContentsView::LockContentsView(
|
||||
detachable_base_error_bubble_->set_persistent(true);
|
||||
|
||||
tooltip_bubble_ = AddChildView(std::make_unique<LoginTooltipView>(
|
||||
base::UTF8ToUTF16("") /*message*/, nullptr /*anchor_view*/));
|
||||
u"" /*message*/, nullptr /*anchor_view*/));
|
||||
tooltip_bubble_->set_positioning_strategy(
|
||||
LoginBaseBubbleView::PositioningStrategy::kTryBeforeThenAfter);
|
||||
tooltip_bubble_->SetPadding(kHorizontalPaddingLoginTooltipViewDp,
|
||||
|
@ -412,7 +412,7 @@ TEST_F(LockScreenSanityTest, RemoveUser) {
|
||||
TEST_F(LockScreenSanityTest, LockScreenKillsPreventsClipboardPaste) {
|
||||
{
|
||||
ui::ScopedClipboardWriter writer(ui::ClipboardBuffer::kCopyPaste);
|
||||
writer.WriteText(base::UTF8ToUTF16("password"));
|
||||
writer.WriteText(u"password");
|
||||
}
|
||||
|
||||
ShowLockScreen();
|
||||
@ -430,7 +430,7 @@ TEST_F(LockScreenSanityTest, LockScreenKillsPreventsClipboardPaste) {
|
||||
text_input->RequestFocus();
|
||||
generator->PressKey(ui::KeyboardCode::VKEY_V, ui::EF_CONTROL_DOWN);
|
||||
|
||||
EXPECT_EQ(base::UTF8ToUTF16("password"), text_input->GetText());
|
||||
EXPECT_EQ(u"password", text_input->GetText());
|
||||
}
|
||||
|
||||
} // namespace ash
|
||||
|
@ -37,8 +37,7 @@ class LoginBaseBubbleViewTest : public LoginTestBase {
|
||||
SetWidget(CreateWidgetWithContent(container_));
|
||||
|
||||
bubble_ = new LoginBaseBubbleView(anchor_, widget()->GetNativeView());
|
||||
auto* label = new views::Label(base::UTF8ToUTF16("A message"),
|
||||
views::style::CONTEXT_LABEL,
|
||||
auto* label = new views::Label(u"A message", views::style::CONTEXT_LABEL,
|
||||
views::style::STYLE_PRIMARY);
|
||||
bubble_->SetLayoutManager(std::make_unique<views::BoxLayout>(
|
||||
views::BoxLayout::Orientation::kVertical));
|
||||
|
@ -22,8 +22,7 @@ TEST_F(LoginErrorBubbleTest, PersistentEventHandling) {
|
||||
auto* anchor_view = new views::View;
|
||||
container->AddChildView(anchor_view);
|
||||
|
||||
auto* label = new views::Label(base::UTF8ToUTF16("A message"),
|
||||
views::style::CONTEXT_LABEL,
|
||||
auto* label = new views::Label(u"A message", views::style::CONTEXT_LABEL,
|
||||
views::style::STYLE_PRIMARY);
|
||||
|
||||
auto* bubble = new LoginErrorBubble(label /*content*/, anchor_view);
|
||||
|
@ -266,7 +266,7 @@ bool LoginPinInputView::OnKeyPressed(const ui::KeyEvent& event) {
|
||||
// when the last digit is inserted.
|
||||
if (event.key_code() == ui::KeyboardCode::VKEY_RETURN && !is_read_only_ &&
|
||||
authenticate_with_empty_pin_on_return_key_) {
|
||||
SubmitPin(base::UTF8ToUTF16(""));
|
||||
SubmitPin(u"");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ using testing::ElementsAre;
|
||||
|
||||
void NotifyControllerForFinalSpeechResult(ProjectorControllerImpl* controller) {
|
||||
controller->OnTranscription(
|
||||
base::UTF8ToUTF16("transcript text 1"),
|
||||
u"transcript text 1",
|
||||
base::TimeDelta::FromMilliseconds(0) /* audio_start_time */,
|
||||
base::TimeDelta::FromMilliseconds(3000) /* audio_end_time */,
|
||||
{{base::TimeDelta::FromMilliseconds(1000),
|
||||
@ -44,7 +44,7 @@ void NotifyControllerForFinalSpeechResult(ProjectorControllerImpl* controller) {
|
||||
void NotifyControllerForPartialSpeechResult(
|
||||
ProjectorControllerImpl* controller) {
|
||||
controller->OnTranscription(
|
||||
base::UTF8ToUTF16("transcript partial text 1"),
|
||||
u"transcript partial text 1",
|
||||
base::TimeDelta::FromMilliseconds(0) /* audio_start_time */,
|
||||
base::TimeDelta::FromMilliseconds(3000) /* audio_end_time */,
|
||||
{{base::TimeDelta::FromMilliseconds(1000),
|
||||
|
@ -224,9 +224,8 @@ class ArcNotificationContentViewTest : public AshTestBase {
|
||||
message_center::SettingsButtonHandler::DELEGATE;
|
||||
Notification notification(
|
||||
message_center::NOTIFICATION_TYPE_CUSTOM,
|
||||
notification_item->GetNotificationId(), base::UTF8ToUTF16("title"),
|
||||
base::UTF8ToUTF16("message"), gfx::Image(), base::UTF8ToUTF16("arc"),
|
||||
GURL(),
|
||||
notification_item->GetNotificationId(), u"title", u"message",
|
||||
gfx::Image(), u"arc", GURL(),
|
||||
message_center::NotifierId(
|
||||
message_center::NotifierType::ARC_APPLICATION, "ARC_NOTIFICATION"),
|
||||
optional_fields,
|
||||
@ -325,9 +324,8 @@ TEST_F(ArcNotificationContentViewTest, CloseButton) {
|
||||
// ARC to avoid surface shutdown issues.
|
||||
auto mc_notification = std::make_unique<Notification>(
|
||||
message_center::NOTIFICATION_TYPE_SIMPLE,
|
||||
notification_item->GetNotificationId(), base::UTF8ToUTF16("title"),
|
||||
base::UTF8ToUTF16("message"), gfx::Image(), base::UTF8ToUTF16("arc"),
|
||||
GURL(),
|
||||
notification_item->GetNotificationId(), u"title", u"message",
|
||||
gfx::Image(), u"arc", GURL(),
|
||||
message_center::NotifierId(message_center::NotifierType::ARC_APPLICATION,
|
||||
"ARC_NOTIFICATION"),
|
||||
message_center::RichNotificationData(), nullptr);
|
||||
|
@ -120,8 +120,8 @@ void ArcNotificationItemImpl::OnUpdatedFromAndroid(
|
||||
message_center::NOTIFICATION_TYPE_CUSTOM, notification_id_,
|
||||
base::UTF8ToUTF16(data->title), base::UTF8ToUTF16(data->message),
|
||||
gfx::Image(),
|
||||
base::UTF8ToUTF16("arc"), // display source
|
||||
GURL(), // empty origin url, for system component
|
||||
u"arc", // display source
|
||||
GURL(), // empty origin url, for system component
|
||||
notifier_id, rich_data,
|
||||
new ArcNotificationDelegate(weak_ptr_factory_.GetWeakPtr()));
|
||||
notification->set_timestamp(base::Time::FromJavaTime(data->time));
|
||||
|
@ -105,8 +105,7 @@ class ArcNotificationViewTest : public AshTestBase {
|
||||
std::unique_ptr<Notification> CreateSimpleNotification() {
|
||||
std::unique_ptr<Notification> notification = std::make_unique<Notification>(
|
||||
message_center::NOTIFICATION_TYPE_CUSTOM, kDefaultNotificationId,
|
||||
base::UTF8ToUTF16("title"), base::UTF8ToUTF16("message"), gfx::Image(),
|
||||
base::UTF8ToUTF16("display source"), GURL(),
|
||||
u"title", u"message", gfx::Image(), u"display source", GURL(),
|
||||
message_center::NotifierId(
|
||||
message_center::NotifierType::ARC_APPLICATION, "test_app_id"),
|
||||
message_center::RichNotificationData(), nullptr);
|
||||
@ -301,8 +300,7 @@ TEST_F(ArcNotificationViewTest, SnoozeButton) {
|
||||
rich_data.should_show_snooze_button = true;
|
||||
std::unique_ptr<Notification> notification = std::make_unique<Notification>(
|
||||
message_center::NOTIFICATION_TYPE_CUSTOM, kDefaultNotificationId,
|
||||
base::UTF8ToUTF16("title"), base::UTF8ToUTF16("message"), gfx::Image(),
|
||||
base::UTF8ToUTF16("display source"), GURL(),
|
||||
u"title", u"message", gfx::Image(), u"display source", GURL(),
|
||||
message_center::NotifierId(message_center::NotifierType::ARC_APPLICATION,
|
||||
"test_app_id"),
|
||||
rich_data, nullptr);
|
||||
|
@ -548,7 +548,7 @@ void ImeMenuTray::UpdateTrayLabel() {
|
||||
AshColorProvider::ContentLayerType::kIconColorPrimary));
|
||||
|
||||
if (current_ime.third_party)
|
||||
label_->SetText(current_ime.short_name + base::UTF8ToUTF16("*"));
|
||||
label_->SetText(current_ime.short_name + u"*");
|
||||
else
|
||||
label_->SetText(current_ime.short_name);
|
||||
}
|
||||
|
@ -134,23 +134,23 @@ TEST_F(ImeMenuTrayTest, TrayLabelTest) {
|
||||
|
||||
ImeInfo info1;
|
||||
info1.id = "ime1";
|
||||
info1.name = UTF8ToUTF16("English");
|
||||
info1.short_name = UTF8ToUTF16("US");
|
||||
info1.name = u"English";
|
||||
info1.short_name = u"US";
|
||||
info1.third_party = false;
|
||||
|
||||
ImeInfo info2;
|
||||
info2.id = "ime2";
|
||||
info2.name = UTF8ToUTF16("English UK");
|
||||
info2.short_name = UTF8ToUTF16("UK");
|
||||
info2.name = u"English UK";
|
||||
info2.short_name = u"UK";
|
||||
info2.third_party = true;
|
||||
|
||||
// Changes the input method to "ime1".
|
||||
SetCurrentIme("ime1", {info1, info2});
|
||||
EXPECT_EQ(UTF8ToUTF16("US"), GetTrayText());
|
||||
EXPECT_EQ(u"US", GetTrayText());
|
||||
|
||||
// Changes the input method to a third-party IME extension.
|
||||
SetCurrentIme("ime2", {info1, info2});
|
||||
EXPECT_EQ(UTF8ToUTF16("UK*"), GetTrayText());
|
||||
EXPECT_EQ(u"UK*", GetTrayText());
|
||||
}
|
||||
|
||||
// Tests that IME menu tray changes background color when tapped/clicked. And
|
||||
@ -202,30 +202,30 @@ TEST_F(ImeMenuTrayTest, RefreshImeWithListViewCreated) {
|
||||
|
||||
ImeInfo info1, info2, info3;
|
||||
info1.id = "ime1";
|
||||
info1.name = UTF8ToUTF16("English");
|
||||
info1.short_name = UTF8ToUTF16("US");
|
||||
info1.name = u"English";
|
||||
info1.short_name = u"US";
|
||||
info1.third_party = false;
|
||||
|
||||
info2.id = "ime2";
|
||||
info2.name = UTF8ToUTF16("English UK");
|
||||
info2.short_name = UTF8ToUTF16("UK");
|
||||
info2.name = u"English UK";
|
||||
info2.short_name = u"UK";
|
||||
info2.third_party = true;
|
||||
|
||||
info3.id = "ime3";
|
||||
info3.name = UTF8ToUTF16("Pinyin");
|
||||
info3.short_name = UTF8ToUTF16("拼");
|
||||
info3.name = u"Pinyin";
|
||||
info3.short_name = u"拼";
|
||||
info3.third_party = false;
|
||||
|
||||
std::vector<ImeInfo> ime_info_list{info1, info2, info3};
|
||||
|
||||
// Switch to ime1.
|
||||
SetCurrentIme("ime1", ime_info_list);
|
||||
EXPECT_EQ(UTF8ToUTF16("US"), GetTrayText());
|
||||
EXPECT_EQ(u"US", GetTrayText());
|
||||
ExpectValidImeList(ime_info_list, info1);
|
||||
|
||||
// Switch to ime3.
|
||||
SetCurrentIme("ime3", ime_info_list);
|
||||
EXPECT_EQ(UTF8ToUTF16("拼"), GetTrayText());
|
||||
EXPECT_EQ(u"拼", GetTrayText());
|
||||
ExpectValidImeList(ime_info_list, info3);
|
||||
|
||||
// Closes the menu before quitting.
|
||||
|
@ -66,8 +66,7 @@ TEST_F(LocaleFeaturePodControllerTest, ButtonVisibility) {
|
||||
|
||||
// The button is visible if the locale list is non-empty.
|
||||
std::vector<LocaleInfo> locale_list;
|
||||
locale_list.emplace_back(kDefaultLocaleIsoCode,
|
||||
base::UTF8ToUTF16("English (United States)"));
|
||||
locale_list.emplace_back(kDefaultLocaleIsoCode, u"English (United States)");
|
||||
Shell::Get()->system_tray_model()->SetLocaleList(std::move(locale_list),
|
||||
kDefaultLocaleIsoCode);
|
||||
button.reset(controller_->CreateButton());
|
||||
|
@ -127,10 +127,10 @@ class AshMessagePopupCollectionTest : public AshTestBase {
|
||||
std::unique_ptr<message_center::Notification> CreateNotification(
|
||||
const std::string& id) {
|
||||
return std::make_unique<message_center::Notification>(
|
||||
message_center::NOTIFICATION_TYPE_BASE_FORMAT, id,
|
||||
base::UTF8ToUTF16("test_title"), base::UTF8ToUTF16("test message"),
|
||||
gfx::Image(), std::u16string() /* display_source */, GURL(),
|
||||
message_center::NotifierId(), message_center::RichNotificationData(),
|
||||
message_center::NOTIFICATION_TYPE_BASE_FORMAT, id, u"test_title",
|
||||
u"test message", gfx::Image(), std::u16string() /* display_source */,
|
||||
GURL(), message_center::NotifierId(),
|
||||
message_center::RichNotificationData(),
|
||||
new message_center::NotificationDelegate());
|
||||
}
|
||||
|
||||
|
@ -75,10 +75,9 @@ class InactiveUserNotificationBlockerTest
|
||||
id_with_profile.profile_id = profile_id;
|
||||
|
||||
message_center::Notification notification(
|
||||
message_center::NOTIFICATION_TYPE_SIMPLE, "popup-id",
|
||||
UTF8ToUTF16("popup-title"), UTF8ToUTF16("popup-message"), gfx::Image(),
|
||||
UTF8ToUTF16("popup-source"), GURL(), id_with_profile,
|
||||
message_center::RichNotificationData(), nullptr);
|
||||
message_center::NOTIFICATION_TYPE_SIMPLE, "popup-id", u"popup-title",
|
||||
u"popup-message", gfx::Image(), u"popup-source", GURL(),
|
||||
id_with_profile, message_center::RichNotificationData(), nullptr);
|
||||
|
||||
if (notifier_id.id == kNotifierSystemPriority)
|
||||
notification.set_priority(message_center::SYSTEM_PRIORITY);
|
||||
@ -93,9 +92,9 @@ class InactiveUserNotificationBlockerTest
|
||||
|
||||
message_center::Notification notification(
|
||||
message_center::NOTIFICATION_TYPE_SIMPLE, "notification-id",
|
||||
UTF8ToUTF16("notification-title"), UTF8ToUTF16("notification-message"),
|
||||
gfx::Image(), UTF8ToUTF16("notification-source"), GURL(),
|
||||
id_with_profile, message_center::RichNotificationData(), nullptr);
|
||||
u"notification-title", u"notification-message", gfx::Image(),
|
||||
u"notification-source", GURL(), id_with_profile,
|
||||
message_center::RichNotificationData(), nullptr);
|
||||
|
||||
if (notifier_id.id == kNotifierSystemPriority)
|
||||
notification.set_priority(message_center::SYSTEM_PRIORITY);
|
||||
|
@ -21,8 +21,8 @@ void AddNotification(const std::string& notification_id,
|
||||
message_center::MessageCenter::Get()->AddNotification(
|
||||
std::make_unique<message_center::Notification>(
|
||||
message_center::NOTIFICATION_TYPE_BASE_FORMAT, notification_id,
|
||||
base::UTF8ToUTF16("test_title"), base::UTF8ToUTF16("test message"),
|
||||
gfx::Image(), /*display_source=*/std::u16string(), GURL(),
|
||||
u"test_title", u"test message", gfx::Image(),
|
||||
/*display_source=*/std::u16string(), GURL(),
|
||||
message_center::NotifierId(message_center::NotifierType::APPLICATION,
|
||||
app_id),
|
||||
message_center::RichNotificationData(),
|
||||
|
@ -72,9 +72,8 @@ class NotificationSwipeControlViewTest : public testing::Test {
|
||||
message_center::SettingsButtonHandler::DELEGATE;
|
||||
rich_data.should_show_snooze_button = true;
|
||||
message_center::Notification notification(
|
||||
message_center::NOTIFICATION_TYPE_SIMPLE, "id",
|
||||
base::UTF8ToUTF16("title"), base::UTF8ToUTF16("id"), gfx::Image(),
|
||||
std::u16string(), GURL(),
|
||||
message_center::NOTIFICATION_TYPE_SIMPLE, "id", u"title", u"id",
|
||||
gfx::Image(), std::u16string(), GURL(),
|
||||
message_center::NotifierId(message_center::NotifierType::APPLICATION,
|
||||
"notifier_id"),
|
||||
rich_data, nullptr);
|
||||
|
@ -60,8 +60,8 @@ class SessionStateNotificationBlockerTest
|
||||
const message_center::NotifierId& notifier_id) {
|
||||
message_center::Notification notification(
|
||||
message_center::NOTIFICATION_TYPE_SIMPLE, "chromeos-id",
|
||||
UTF8ToUTF16("chromeos-title"), UTF8ToUTF16("chromeos-message"),
|
||||
gfx::Image(), UTF8ToUTF16("chromeos-source"), GURL(), notifier_id,
|
||||
u"chromeos-title", u"chromeos-message", gfx::Image(),
|
||||
u"chromeos-source", GURL(), notifier_id,
|
||||
message_center::RichNotificationData(), nullptr);
|
||||
if (notifier_id.id == kNotifierSystemPriority)
|
||||
notification.set_priority(message_center::SYSTEM_PRIORITY);
|
||||
|
@ -38,10 +38,10 @@ class UnifiedMessageCenterBubbleTest : public AshTestBase {
|
||||
std::string AddNotification() {
|
||||
std::string id = base::NumberToString(id_++);
|
||||
MessageCenter::Get()->AddNotification(std::make_unique<Notification>(
|
||||
message_center::NOTIFICATION_TYPE_BASE_FORMAT, id,
|
||||
base::UTF8ToUTF16("test title"), base::UTF8ToUTF16("test message"),
|
||||
gfx::Image(), std::u16string() /* display_source */, GURL(),
|
||||
message_center::NotifierId(), message_center::RichNotificationData(),
|
||||
message_center::NOTIFICATION_TYPE_BASE_FORMAT, id, u"test title",
|
||||
u"test message", gfx::Image(), std::u16string() /* display_source */,
|
||||
GURL(), message_center::NotifierId(),
|
||||
message_center::RichNotificationData(),
|
||||
new message_center::NotificationDelegate()));
|
||||
return id;
|
||||
}
|
||||
|
@ -90,10 +90,9 @@ class UnifiedMessageCenterViewTest : public AshTestBase,
|
||||
message_center::RichNotificationData data;
|
||||
data.pinned = pinned;
|
||||
MessageCenter::Get()->AddNotification(std::make_unique<Notification>(
|
||||
message_center::NOTIFICATION_TYPE_BASE_FORMAT, id,
|
||||
base::UTF8ToUTF16("test title"), base::UTF8ToUTF16("test message"),
|
||||
gfx::Image(), std::u16string() /* display_source */, GURL(),
|
||||
message_center::NotifierId(), data,
|
||||
message_center::NOTIFICATION_TYPE_BASE_FORMAT, id, u"test title",
|
||||
u"test message", gfx::Image(), std::u16string() /* display_source */,
|
||||
GURL(), message_center::NotifierId(), data,
|
||||
new message_center::NotificationDelegate()));
|
||||
return id;
|
||||
}
|
||||
|
@ -65,10 +65,10 @@ class TestUnifiedMessageListView : public UnifiedMessageListView {
|
||||
for (int i = 0; i < stacked_notification_count; i++) {
|
||||
std::string id = base::NumberToString(0);
|
||||
auto notification = std::make_unique<Notification>(
|
||||
message_center::NOTIFICATION_TYPE_BASE_FORMAT, id,
|
||||
base::UTF8ToUTF16("test title"), base::UTF8ToUTF16("test message"),
|
||||
gfx::Image(), std::u16string() /* display_source */, GURL(),
|
||||
message_center::NotifierId(), message_center::RichNotificationData(),
|
||||
message_center::NOTIFICATION_TYPE_BASE_FORMAT, id, u"test title",
|
||||
u"test message", gfx::Image(), std::u16string() /* display_source */,
|
||||
GURL(), message_center::NotifierId(),
|
||||
message_center::RichNotificationData(),
|
||||
new message_center::NotificationDelegate());
|
||||
|
||||
stacked_notifications_.push_back(notification.get());
|
||||
@ -125,10 +125,10 @@ class UnifiedMessageListViewTest : public AshTestBase,
|
||||
std::string AddNotification(bool pinned = false) {
|
||||
std::string id = base::NumberToString(id_++);
|
||||
auto notification = std::make_unique<Notification>(
|
||||
message_center::NOTIFICATION_TYPE_BASE_FORMAT, id,
|
||||
base::UTF8ToUTF16("test title"), base::UTF8ToUTF16("test message"),
|
||||
gfx::Image(), std::u16string() /* display_source */, GURL(),
|
||||
message_center::NotifierId(), message_center::RichNotificationData(),
|
||||
message_center::NOTIFICATION_TYPE_BASE_FORMAT, id, u"test title",
|
||||
u"test message", gfx::Image(), std::u16string() /* display_source */,
|
||||
GURL(), message_center::NotifierId(),
|
||||
message_center::RichNotificationData(),
|
||||
new message_center::NotificationDelegate());
|
||||
notification->set_pinned(pinned);
|
||||
MessageCenter::Get()->AddNotification(std::move(notification));
|
||||
|
@ -179,8 +179,8 @@ TEST_F(PhoneHubNotificationControllerTest, CloseByUser) {
|
||||
TEST_F(PhoneHubNotificationControllerTest, InlineReply) {
|
||||
notification_manager_->SetNotificationsInternal(fake_notifications_);
|
||||
|
||||
const std::u16string kInlineReply0 = base::UTF8ToUTF16("inline reply 0");
|
||||
const std::u16string kInlineReply1 = base::UTF8ToUTF16("inline reply 1");
|
||||
const std::u16string kInlineReply0 = u"inline reply 0";
|
||||
const std::u16string kInlineReply1 = u"inline reply 1";
|
||||
message_center_->ClickOnNotificationButtonWithReply(kCrOSNotificationId0, 0,
|
||||
kInlineReply0);
|
||||
message_center_->ClickOnNotificationButtonWithReply(kCrOSNotificationId1, 0,
|
||||
@ -267,7 +267,7 @@ TEST_F(PhoneHubNotificationControllerTest, NotificationHasPhoneName) {
|
||||
notification_manager_->SetNotificationsInternal(fake_notifications_);
|
||||
auto* notification = FindNotification(kCrOSNotificationId0);
|
||||
|
||||
const std::u16string expected_phone_name = base::UTF8ToUTF16("Phone name");
|
||||
const std::u16string expected_phone_name = u"Phone name";
|
||||
phone_hub_manager_.mutable_phone_model()->SetPhoneName(expected_phone_name);
|
||||
|
||||
auto notification_view =
|
||||
@ -297,7 +297,7 @@ TEST_F(PhoneHubNotificationControllerTest, ReplyBrieflyDisabled) {
|
||||
views::View* reply_button = action_buttons_row->children()[0];
|
||||
|
||||
// Initially, reply button should be disabled after replied.
|
||||
const std::u16string kInlineReply0 = base::UTF8ToUTF16("inline reply 0");
|
||||
const std::u16string kInlineReply0 = u"inline reply 0";
|
||||
notification_view_md->OnNotificationInputSubmit(0, kInlineReply0);
|
||||
EXPECT_FALSE(reply_button->GetEnabled());
|
||||
|
||||
@ -367,7 +367,7 @@ TEST_F(PhoneHubNotificationControllerTest, DoNotReshowPopupNotification) {
|
||||
base::Time::Now(), chromeos::phonehub::Notification::Importance::kHigh,
|
||||
/*inline_reply_id=*/0,
|
||||
chromeos::phonehub::Notification::InteractionBehavior::kNone,
|
||||
base::UTF8ToUTF16(kTitle), base::UTF8ToUTF16("New text"));
|
||||
base::UTF8ToUTF16(kTitle), u"New text");
|
||||
|
||||
// Update the existingt notification; the priority should be MAX_PRIORITY, and
|
||||
// renotify should be true.
|
||||
|
@ -61,9 +61,9 @@ class PhoneStatusViewTest : public AshTestBase,
|
||||
};
|
||||
|
||||
TEST_F(PhoneStatusViewTest, PhoneStatusLabelsContent) {
|
||||
std::u16string expected_name_text = base::UTF8ToUTF16("Test Phone Name");
|
||||
std::u16string expected_provider_text = base::UTF8ToUTF16("Test Provider");
|
||||
std::u16string expected_battery_text = base::UTF8ToUTF16("10%");
|
||||
std::u16string expected_name_text = u"Test Phone Name";
|
||||
std::u16string expected_provider_text = u"Test Provider";
|
||||
std::u16string expected_battery_text = u"10%";
|
||||
|
||||
phone_model_.SetPhoneName(expected_name_text);
|
||||
|
||||
@ -81,9 +81,9 @@ TEST_F(PhoneStatusViewTest, PhoneStatusLabelsContent) {
|
||||
EXPECT_EQ(expected_name_text, status_view_->phone_name_label_->GetText());
|
||||
EXPECT_EQ(expected_battery_text, status_view_->battery_label_->GetText());
|
||||
|
||||
expected_name_text = base::UTF8ToUTF16("New Phone Name");
|
||||
expected_provider_text = base::UTF8ToUTF16("New Provider");
|
||||
expected_battery_text = base::UTF8ToUTF16("20%");
|
||||
expected_name_text = u"New Phone Name";
|
||||
expected_provider_text = u"New Provider";
|
||||
expected_battery_text = u"20%";
|
||||
|
||||
phone_model_.SetPhoneName(expected_name_text);
|
||||
metadata.mobile_provider = expected_provider_text;
|
||||
|
@ -147,7 +147,7 @@ std::u16string GetEnterMirrorModeMessage() {
|
||||
for (auto& id :
|
||||
GetDisplayManager()->GetMirroringDestinationDisplayIdList()) {
|
||||
if (!display_names.empty())
|
||||
display_names.append(base::UTF8ToUTF16(","));
|
||||
display_names.append(u",");
|
||||
display_names.append(GetDisplayName(id));
|
||||
}
|
||||
return l10n_util::GetStringFUTF16(IDS_ASH_STATUS_TRAY_DISPLAY_MIRRORING,
|
||||
|
@ -123,7 +123,7 @@ std::u16string ScreenLayoutObserverTest::GetMirroringDisplayNames() {
|
||||
std::u16string display_names;
|
||||
for (auto& id : display_manager()->GetMirroringDestinationDisplayIdList()) {
|
||||
if (!display_names.empty())
|
||||
display_names.append(base::UTF8ToUTF16(","));
|
||||
display_names.append(u",");
|
||||
display_names.append(
|
||||
base::UTF8ToUTF16(display_manager()->GetDisplayNameForId(id)));
|
||||
}
|
||||
@ -377,20 +377,20 @@ TEST_F(ScreenLayoutObserverTest, ZoomingInUnifiedModeNotification) {
|
||||
CloseNotification();
|
||||
int64_t display_id = display::Screen::GetScreen()->GetPrimaryDisplay().id();
|
||||
EXPECT_TRUE(display_manager()->ZoomDisplay(display_id, false /* up */));
|
||||
EXPECT_EQ(l10n_util::GetStringFUTF16(
|
||||
IDS_ASH_STATUS_TRAY_DISPLAY_RESOLUTION_CHANGED,
|
||||
GetUnifiedDisplayName(), base::UTF8ToUTF16("400x200")),
|
||||
GetDisplayNotificationAdditionalText());
|
||||
EXPECT_EQ(
|
||||
l10n_util::GetStringFUTF16(IDS_ASH_STATUS_TRAY_DISPLAY_RESOLUTION_CHANGED,
|
||||
GetUnifiedDisplayName(), u"400x200"),
|
||||
GetDisplayNotificationAdditionalText());
|
||||
EXPECT_EQ(l10n_util::GetStringUTF16(
|
||||
IDS_ASH_STATUS_TRAY_DISPLAY_RESOLUTION_CHANGED_TITLE),
|
||||
GetDisplayNotificationText());
|
||||
|
||||
CloseNotification();
|
||||
EXPECT_TRUE(display_manager()->ZoomDisplay(display_id, true /* up */));
|
||||
EXPECT_EQ(l10n_util::GetStringFUTF16(
|
||||
IDS_ASH_STATUS_TRAY_DISPLAY_RESOLUTION_CHANGED,
|
||||
GetUnifiedDisplayName(), base::UTF8ToUTF16("800x400")),
|
||||
GetDisplayNotificationAdditionalText());
|
||||
EXPECT_EQ(
|
||||
l10n_util::GetStringFUTF16(IDS_ASH_STATUS_TRAY_DISPLAY_RESOLUTION_CHANGED,
|
||||
GetUnifiedDisplayName(), u"800x400"),
|
||||
GetDisplayNotificationAdditionalText());
|
||||
EXPECT_EQ(l10n_util::GetStringUTF16(
|
||||
IDS_ASH_STATUS_TRAY_DISPLAY_RESOLUTION_CHANGED_TITLE),
|
||||
GetDisplayNotificationText());
|
||||
@ -426,8 +426,7 @@ TEST_F(ScreenLayoutObserverTest, DisplayConfigurationChangedTwice) {
|
||||
UpdateDisplay("400x400");
|
||||
EXPECT_TRUE(base::StartsWith(
|
||||
GetDisplayNotificationText(),
|
||||
l10n_util::GetStringFUTF16(IDS_ASH_STATUS_TRAY_DISPLAY_REMOVED,
|
||||
base::UTF8ToUTF16("")),
|
||||
l10n_util::GetStringFUTF16(IDS_ASH_STATUS_TRAY_DISPLAY_REMOVED, u""),
|
||||
base::CompareCase::SENSITIVE));
|
||||
}
|
||||
|
||||
@ -530,8 +529,7 @@ TEST_F(ScreenLayoutObserverTest, AddingRemovingDisplayExtendedModeMessage) {
|
||||
UpdateDisplay("400x400");
|
||||
EXPECT_TRUE(base::StartsWith(
|
||||
GetDisplayNotificationText(),
|
||||
l10n_util::GetStringFUTF16(IDS_ASH_STATUS_TRAY_DISPLAY_REMOVED,
|
||||
base::UTF8ToUTF16("")),
|
||||
l10n_util::GetStringFUTF16(IDS_ASH_STATUS_TRAY_DISPLAY_REMOVED, u""),
|
||||
base::CompareCase::SENSITIVE));
|
||||
}
|
||||
|
||||
|
@ -62,8 +62,8 @@ class TrayEventFilterTest : public AshTestBase {
|
||||
std::string notification_id = base::NumberToString(notification_id_++);
|
||||
MessageCenter::Get()->AddNotification(std::make_unique<Notification>(
|
||||
message_center::NOTIFICATION_TYPE_BASE_FORMAT, notification_id,
|
||||
base::UTF8ToUTF16("test title"), base::UTF8ToUTF16("test message"),
|
||||
gfx::Image(), std::u16string() /* display_source */, GURL(),
|
||||
u"test title", u"test message", gfx::Image(),
|
||||
std::u16string() /* display_source */, GURL(),
|
||||
message_center::NotifierId(), message_center::RichNotificationData(),
|
||||
new message_center::NotificationDelegate()));
|
||||
return notification_id;
|
||||
|
@ -29,8 +29,8 @@ void AddNotification(const std::string& notification_id,
|
||||
message_center::MessageCenter::Get()->AddNotification(
|
||||
std::make_unique<message_center::Notification>(
|
||||
message_center::NOTIFICATION_TYPE_BASE_FORMAT, notification_id,
|
||||
base::UTF8ToUTF16("test_title"), base::UTF8ToUTF16("test message"),
|
||||
gfx::Image(), /*display_source=*/std::u16string(), GURL(),
|
||||
u"test_title", u"test message", gfx::Image(),
|
||||
/*display_source=*/std::u16string(), GURL(),
|
||||
message_center::NotifierId(message_center::NotifierType::APPLICATION,
|
||||
"app"),
|
||||
rich_notification_data, new message_center::NotificationDelegate()));
|
||||
|
@ -68,9 +68,9 @@ class NotificationIconsControllerTest
|
||||
|
||||
message_center::MessageCenter::Get()->AddNotification(
|
||||
CreateSystemNotification(
|
||||
message_center::NOTIFICATION_TYPE_SIMPLE, id,
|
||||
base::UTF8ToUTF16("test_title"), base::UTF8ToUTF16("test message"),
|
||||
std::u16string() /*display_source */, GURL() /* origin_url */,
|
||||
message_center::NOTIFICATION_TYPE_SIMPLE, id, u"test_title",
|
||||
u"test message", std::u16string() /*display_source */,
|
||||
GURL() /* origin_url */,
|
||||
message_center::NotifierId(
|
||||
message_center::NotifierType::SYSTEM_COMPONENT, app_id),
|
||||
rich_notification_data, nullptr /* delegate */, gfx::VectorIcon(),
|
||||
|
@ -1998,8 +1998,8 @@ TEST_F(DesksEditableNamesTest, NamesSetByUsersAreNotOverwritten) {
|
||||
// Extra whitespace should be trimmed.
|
||||
auto* desk_1 = controller()->desks()[0].get();
|
||||
auto* desk_2 = controller()->desks()[1].get();
|
||||
EXPECT_EQ(base::UTF8ToUTF16("code"), desk_1->name());
|
||||
EXPECT_EQ(base::UTF8ToUTF16("Desk 2"), desk_2->name());
|
||||
EXPECT_EQ(u"code", desk_1->name());
|
||||
EXPECT_EQ(u"Desk 2", desk_2->name());
|
||||
EXPECT_TRUE(desk_1->is_name_set_by_user());
|
||||
EXPECT_FALSE(desk_2->is_name_set_by_user());
|
||||
|
||||
@ -2012,7 +2012,7 @@ TEST_F(DesksEditableNamesTest, NamesSetByUsersAreNotOverwritten) {
|
||||
// the user-modified desk names.
|
||||
NewDesk();
|
||||
auto* desk_3 = controller()->desks()[2].get();
|
||||
EXPECT_EQ(base::UTF8ToUTF16("Desk 3"), desk_3->name());
|
||||
EXPECT_EQ(u"Desk 3", desk_3->name());
|
||||
EXPECT_TRUE(desk_1->is_name_set_by_user());
|
||||
EXPECT_FALSE(desk_2->is_name_set_by_user());
|
||||
EXPECT_FALSE(desk_3->is_name_set_by_user());
|
||||
@ -2025,7 +2025,7 @@ TEST_F(DesksEditableNamesTest, NamesSetByUsersAreNotOverwritten) {
|
||||
EXPECT_TRUE(desk_1->is_name_set_by_user());
|
||||
EXPECT_FALSE(desk_3->is_name_set_by_user());
|
||||
// Desk 3 will now be renamed to "Desk 2".
|
||||
EXPECT_EQ(base::UTF8ToUTF16("Desk 2"), desk_3->name());
|
||||
EXPECT_EQ(u"Desk 2", desk_3->name());
|
||||
VerifyDesksRestoreData(GetPrimaryUserPrefService(),
|
||||
{std::string("code"), std::string()});
|
||||
|
||||
@ -2033,8 +2033,8 @@ TEST_F(DesksEditableNamesTest, NamesSetByUsersAreNotOverwritten) {
|
||||
overview_controller->StartOverview();
|
||||
EXPECT_TRUE(desk_1->is_name_set_by_user());
|
||||
EXPECT_FALSE(desk_3->is_name_set_by_user());
|
||||
EXPECT_EQ(base::UTF8ToUTF16("code"), desk_1->name());
|
||||
EXPECT_EQ(base::UTF8ToUTF16("Desk 2"), desk_3->name());
|
||||
EXPECT_EQ(u"code", desk_1->name());
|
||||
EXPECT_EQ(u"Desk 2", desk_3->name());
|
||||
}
|
||||
|
||||
TEST_F(DesksEditableNamesTest, DontAllowEmptyNames) {
|
||||
@ -2055,7 +2055,7 @@ TEST_F(DesksEditableNamesTest, DontAllowEmptyNames) {
|
||||
// The name should now revert back to the default value.
|
||||
EXPECT_FALSE(desk_1->name().empty());
|
||||
EXPECT_FALSE(desk_1->is_name_set_by_user());
|
||||
EXPECT_EQ(base::UTF8ToUTF16("Desk 1"), desk_1->name());
|
||||
EXPECT_EQ(u"Desk 1", desk_1->name());
|
||||
VerifyDesksRestoreData(GetPrimaryUserPrefService(),
|
||||
{std::string(), std::string()});
|
||||
}
|
||||
@ -3360,9 +3360,9 @@ TEST_P(DesksRestoreMultiUserTest, DesksRestoredFromPrimaryUserPrefsOnly) {
|
||||
auto verify_desks = [&](const std::string& trace_name) {
|
||||
SCOPED_TRACE(trace_name);
|
||||
EXPECT_EQ(3u, desks.size());
|
||||
EXPECT_EQ(base::UTF8ToUTF16("Desk 1"), desks[0]->name());
|
||||
EXPECT_EQ(base::UTF8ToUTF16("Desk 2"), desks[1]->name());
|
||||
EXPECT_EQ(base::UTF8ToUTF16("code"), desks[2]->name());
|
||||
EXPECT_EQ(u"Desk 1", desks[0]->name());
|
||||
EXPECT_EQ(u"Desk 2", desks[1]->name());
|
||||
EXPECT_EQ(u"code", desks[2]->name());
|
||||
// Restored non-default names should be marked as `set_by_user`.
|
||||
EXPECT_FALSE(desks[0]->is_name_set_by_user());
|
||||
EXPECT_FALSE(desks[1]->is_name_set_by_user());
|
||||
@ -4652,7 +4652,7 @@ TEST_F(DesksBentoTest, ZeroStateDeskButtonText) {
|
||||
ASSERT_TRUE(desks_bar_view->IsZeroState());
|
||||
// Show the default name "Desk 1" while initializing the desks bar at the
|
||||
// first time.
|
||||
EXPECT_EQ(base::UTF8ToUTF16("Desk 1"),
|
||||
EXPECT_EQ(u"Desk 1",
|
||||
desks_bar_view->zero_state_default_desk_button()->GetText());
|
||||
|
||||
auto* event_generator = GetEventGenerator();
|
||||
@ -4672,21 +4672,20 @@ TEST_F(DesksBentoTest, ZeroStateDeskButtonText) {
|
||||
desks_bar_view = GetOverviewGridForRoot(root_window)->desks_bar_view();
|
||||
EXPECT_TRUE(desks_bar_view->IsZeroState());
|
||||
// Should show the desk's current name "test" instead of the default name.
|
||||
EXPECT_EQ(base::UTF8ToUTF16("test"),
|
||||
EXPECT_EQ(u"test",
|
||||
desks_bar_view->zero_state_default_desk_button()->GetText());
|
||||
|
||||
// Create 'Desk 2'.
|
||||
ClickOnView(desks_bar_view->zero_state_new_desk_button(), event_generator);
|
||||
EXPECT_FALSE(desks_bar_view->IsZeroState());
|
||||
SendKey(ui::VKEY_RETURN);
|
||||
EXPECT_EQ(base::UTF8ToUTF16("Desk 2"),
|
||||
DesksController::Get()->desks()[1].get()->name());
|
||||
EXPECT_EQ(u"Desk 2", DesksController::Get()->desks()[1].get()->name());
|
||||
|
||||
// Close desk 'test' should return to zero state and the zero state default
|
||||
// desk button should show current desk's name, which is 'Desk 1'.
|
||||
CloseDeskFromMiniView(desks_bar_view->mini_views()[0], event_generator);
|
||||
EXPECT_TRUE(desks_bar_view->IsZeroState());
|
||||
EXPECT_EQ(base::UTF8ToUTF16("Desk 1"),
|
||||
EXPECT_EQ(u"Desk 1",
|
||||
desks_bar_view->zero_state_default_desk_button()->GetText());
|
||||
|
||||
// Set a super long desk name.
|
||||
|
@ -710,7 +710,7 @@ TEST_F(DesksOverviewHighlightControllerTest, ActivateDeskNameView) {
|
||||
|
||||
EXPECT_FALSE(desk_name_view_1->HasFocus());
|
||||
EXPECT_EQ(desk_bar_view->mini_views()[1], GetHighlightedView());
|
||||
EXPECT_EQ(base::UTF8ToUTF16("code"), desk_1->name());
|
||||
EXPECT_EQ(u"code", desk_1->name());
|
||||
EXPECT_TRUE(desk_1->is_name_set_by_user());
|
||||
}
|
||||
|
||||
|
@ -1614,7 +1614,7 @@ TEST_F(OverviewSessionTest, DragWindowShadow) {
|
||||
// Test that a label is created under the window on entering overview mode.
|
||||
TEST_F(OverviewSessionTest, CreateLabelUnderWindow) {
|
||||
std::unique_ptr<aura::Window> window(CreateTestWindow(gfx::Rect(300, 500)));
|
||||
const std::u16string window_title = base::UTF8ToUTF16("My window");
|
||||
const std::u16string window_title = u"My window";
|
||||
window->SetTitle(window_title);
|
||||
ToggleOverview();
|
||||
OverviewItem* window_item = GetOverviewItemsForRoot(0).back().get();
|
||||
@ -1625,7 +1625,7 @@ TEST_F(OverviewSessionTest, CreateLabelUnderWindow) {
|
||||
EXPECT_EQ(window_title, label->GetText());
|
||||
|
||||
// Update the window title and check that the label is updated, too.
|
||||
const std::u16string updated_title = base::UTF8ToUTF16("Updated title");
|
||||
const std::u16string updated_title = u"Updated title";
|
||||
window->SetTitle(updated_title);
|
||||
EXPECT_EQ(updated_title, label->GetText());
|
||||
|
||||
|
@ -21,7 +21,7 @@ TEST(JniString, BasicConversionsUTF8) {
|
||||
}
|
||||
|
||||
TEST(JniString, BasicConversionsUTF16) {
|
||||
const std::u16string kSimpleString = UTF8ToUTF16("SimpleTest16");
|
||||
const std::u16string kSimpleString = u"SimpleTest16";
|
||||
JNIEnv* env = AttachCurrentThread();
|
||||
std::u16string result =
|
||||
ConvertJavaStringToUTF16(ConvertUTF16ToJavaString(env, kSimpleString));
|
||||
|
@ -30,7 +30,7 @@ TEST(BreakIteratorTest, BreakWordEmpty) {
|
||||
}
|
||||
|
||||
TEST(BreakIteratorTest, BreakWord) {
|
||||
std::u16string space(UTF8ToUTF16(" "));
|
||||
std::u16string space(u" ");
|
||||
std::u16string str(UTF8ToUTF16(" foo bar! \npouet boom"));
|
||||
BreakIterator iter(str, BreakIterator::BREAK_WORD);
|
||||
ASSERT_TRUE(iter.Init());
|
||||
@ -39,16 +39,16 @@ TEST(BreakIteratorTest, BreakWord) {
|
||||
EXPECT_EQ(space, iter.GetString());
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
EXPECT_TRUE(iter.IsWord());
|
||||
EXPECT_EQ(UTF8ToUTF16("foo"), iter.GetString());
|
||||
EXPECT_EQ(u"foo", iter.GetString());
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
EXPECT_FALSE(iter.IsWord());
|
||||
EXPECT_EQ(space, iter.GetString());
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
EXPECT_TRUE(iter.IsWord());
|
||||
EXPECT_EQ(UTF8ToUTF16("bar"), iter.GetString());
|
||||
EXPECT_EQ(u"bar", iter.GetString());
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
EXPECT_FALSE(iter.IsWord());
|
||||
EXPECT_EQ(UTF8ToUTF16("!"), iter.GetString());
|
||||
EXPECT_EQ(u"!", iter.GetString());
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
EXPECT_FALSE(iter.IsWord());
|
||||
EXPECT_EQ(space, iter.GetString());
|
||||
@ -57,13 +57,13 @@ TEST(BreakIteratorTest, BreakWord) {
|
||||
EXPECT_EQ(UTF8ToUTF16("\n"), iter.GetString());
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
EXPECT_TRUE(iter.IsWord());
|
||||
EXPECT_EQ(UTF8ToUTF16("pouet"), iter.GetString());
|
||||
EXPECT_EQ(u"pouet", iter.GetString());
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
EXPECT_FALSE(iter.IsWord());
|
||||
EXPECT_EQ(space, iter.GetString());
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
EXPECT_TRUE(iter.IsWord());
|
||||
EXPECT_EQ(UTF8ToUTF16("boom"), iter.GetString());
|
||||
EXPECT_EQ(u"boom", iter.GetString());
|
||||
EXPECT_FALSE(iter.Advance());
|
||||
EXPECT_FALSE(iter.IsWord());
|
||||
EXPECT_FALSE(iter.Advance()); // Test unexpected advance after end.
|
||||
@ -84,7 +84,7 @@ TEST(BreakIteratorTest, BreakWordWide16) {
|
||||
EXPECT_EQ(word1, iter.GetString());
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
EXPECT_FALSE(iter.IsWord());
|
||||
EXPECT_EQ(UTF8ToUTF16(" "), iter.GetString());
|
||||
EXPECT_EQ(u" ", iter.GetString());
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
EXPECT_TRUE(iter.IsWord());
|
||||
EXPECT_EQ(word2, iter.GetString());
|
||||
@ -108,10 +108,10 @@ TEST(BreakIteratorTest, BreakWordWide32) {
|
||||
EXPECT_EQ(very_wide_word, iter.GetString());
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
EXPECT_FALSE(iter.IsWord());
|
||||
EXPECT_EQ(UTF8ToUTF16(" "), iter.GetString());
|
||||
EXPECT_EQ(u" ", iter.GetString());
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
EXPECT_TRUE(iter.IsWord());
|
||||
EXPECT_EQ(UTF8ToUTF16("a"), iter.GetString());
|
||||
EXPECT_EQ(u"a", iter.GetString());
|
||||
EXPECT_FALSE(iter.Advance());
|
||||
EXPECT_FALSE(iter.IsWord());
|
||||
EXPECT_FALSE(iter.Advance()); // Test unexpected advance after end.
|
||||
@ -190,7 +190,7 @@ TEST(BreakIteratorTest, BreakWordJapanese) {
|
||||
|
||||
TEST(BreakIteratorTest, BreakWordChineseEnglish) {
|
||||
// Terms in Simplified Chinese mixed with English and wide punctuations.
|
||||
std::u16string space(UTF8ToUTF16(" "));
|
||||
std::u16string space(u" ");
|
||||
const char token1[] = "下载";
|
||||
const char token2[] = "Chrome";
|
||||
const char token3[] = "(";
|
||||
@ -257,19 +257,19 @@ TEST(BreakIteratorTest, BreakSpace) {
|
||||
ASSERT_TRUE(iter.Init());
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
EXPECT_FALSE(iter.IsWord());
|
||||
EXPECT_EQ(UTF8ToUTF16(" "), iter.GetString());
|
||||
EXPECT_EQ(u" ", iter.GetString());
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
EXPECT_FALSE(iter.IsWord());
|
||||
EXPECT_EQ(UTF8ToUTF16("foo "), iter.GetString());
|
||||
EXPECT_EQ(u"foo ", iter.GetString());
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
EXPECT_FALSE(iter.IsWord());
|
||||
EXPECT_EQ(UTF8ToUTF16("bar! \n"), iter.GetString());
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
EXPECT_FALSE(iter.IsWord());
|
||||
EXPECT_EQ(UTF8ToUTF16("pouet "), iter.GetString());
|
||||
EXPECT_EQ(u"pouet ", iter.GetString());
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
EXPECT_FALSE(iter.IsWord());
|
||||
EXPECT_EQ(UTF8ToUTF16("boom"), iter.GetString());
|
||||
EXPECT_EQ(u"boom", iter.GetString());
|
||||
EXPECT_FALSE(iter.Advance());
|
||||
EXPECT_FALSE(iter.IsWord());
|
||||
EXPECT_FALSE(iter.Advance()); // Test unexpected advance after end.
|
||||
@ -282,19 +282,19 @@ TEST(BreakIteratorTest, BreakSpaceSP) {
|
||||
ASSERT_TRUE(iter.Init());
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
EXPECT_FALSE(iter.IsWord());
|
||||
EXPECT_EQ(UTF8ToUTF16(" "), iter.GetString());
|
||||
EXPECT_EQ(u" ", iter.GetString());
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
EXPECT_FALSE(iter.IsWord());
|
||||
EXPECT_EQ(UTF8ToUTF16("foo "), iter.GetString());
|
||||
EXPECT_EQ(u"foo ", iter.GetString());
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
EXPECT_FALSE(iter.IsWord());
|
||||
EXPECT_EQ(UTF8ToUTF16("bar! \n"), iter.GetString());
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
EXPECT_FALSE(iter.IsWord());
|
||||
EXPECT_EQ(UTF8ToUTF16("pouet "), iter.GetString());
|
||||
EXPECT_EQ(u"pouet ", iter.GetString());
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
EXPECT_FALSE(iter.IsWord());
|
||||
EXPECT_EQ(UTF8ToUTF16("boom "), iter.GetString());
|
||||
EXPECT_EQ(u"boom ", iter.GetString());
|
||||
EXPECT_FALSE(iter.Advance());
|
||||
EXPECT_FALSE(iter.IsWord());
|
||||
EXPECT_FALSE(iter.Advance()); // Test unexpected advance after end.
|
||||
@ -336,7 +336,7 @@ TEST(BreakIteratorTest, BreakSpaceWide32) {
|
||||
EXPECT_EQ(very_wide_word, iter.GetString());
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
EXPECT_FALSE(iter.IsWord());
|
||||
EXPECT_EQ(UTF8ToUTF16("a"), iter.GetString());
|
||||
EXPECT_EQ(u"a", iter.GetString());
|
||||
EXPECT_FALSE(iter.Advance());
|
||||
EXPECT_FALSE(iter.IsWord());
|
||||
EXPECT_FALSE(iter.Advance()); // Test unexpected advance after end.
|
||||
@ -369,7 +369,7 @@ TEST(BreakIteratorTest, BreakLine) {
|
||||
EXPECT_EQ(nl, iter.GetString());
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
EXPECT_FALSE(iter.IsWord());
|
||||
EXPECT_EQ(UTF8ToUTF16("pouet boom"), iter.GetString());
|
||||
EXPECT_EQ(u"pouet boom", iter.GetString());
|
||||
EXPECT_FALSE(iter.Advance());
|
||||
EXPECT_FALSE(iter.IsWord());
|
||||
EXPECT_FALSE(iter.Advance()); // Test unexpected advance after end.
|
||||
@ -399,7 +399,7 @@ TEST(BreakIteratorTest, BreakSentence) {
|
||||
EXPECT_EQ(UTF8ToUTF16("\tAnother sentence?"), iter.GetString());
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
EXPECT_FALSE(iter.IsWord());
|
||||
EXPECT_EQ(UTF8ToUTF16("One more thing"), iter.GetString());
|
||||
EXPECT_EQ(u"One more thing", iter.GetString());
|
||||
EXPECT_FALSE(iter.Advance()); // Test unexpected advance after end.
|
||||
EXPECT_FALSE(iter.IsWord());
|
||||
}
|
||||
@ -482,7 +482,7 @@ TEST(BreakIteratorTest, BreakLineWide32) {
|
||||
EXPECT_EQ(very_wide_line, iter.GetString());
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
EXPECT_FALSE(iter.IsWord());
|
||||
EXPECT_EQ(UTF8ToUTF16("a"), iter.GetString());
|
||||
EXPECT_EQ(u"a", iter.GetString());
|
||||
EXPECT_FALSE(iter.Advance());
|
||||
EXPECT_FALSE(iter.IsWord());
|
||||
EXPECT_FALSE(iter.Advance()); // Test unexpected advance after end.
|
||||
@ -570,7 +570,7 @@ TEST(BreakIteratorTest, GetWordBreakStatusBreakLine) {
|
||||
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
// Finds "foo" and the space.
|
||||
EXPECT_EQ(base::UTF8ToUTF16("foo "), iter.GetString());
|
||||
EXPECT_EQ(u"foo ", iter.GetString());
|
||||
EXPECT_EQ(iter.GetWordBreakStatus(), BreakIterator::IS_LINE_OR_CHAR_BREAK);
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
// Finds the Khmer characters, the next space, and the newline.
|
||||
@ -578,7 +578,7 @@ TEST(BreakIteratorTest, GetWordBreakStatusBreakLine) {
|
||||
EXPECT_EQ(iter.GetWordBreakStatus(), BreakIterator::IS_LINE_OR_CHAR_BREAK);
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
// Finds "Can" and the space.
|
||||
EXPECT_EQ(base::UTF8ToUTF16("Can "), iter.GetString());
|
||||
EXPECT_EQ(u"Can ", iter.GetString());
|
||||
EXPECT_EQ(iter.GetWordBreakStatus(), BreakIterator::IS_LINE_OR_CHAR_BREAK);
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
// Finds the Russian characters and periods.
|
||||
@ -601,42 +601,42 @@ TEST(BreakIteratorTest, GetWordBreakStatusBreakWord) {
|
||||
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
// Finds "foo".
|
||||
EXPECT_EQ(base::UTF8ToUTF16("foo"), iter.GetString());
|
||||
EXPECT_EQ(u"foo", iter.GetString());
|
||||
EXPECT_EQ(iter.GetWordBreakStatus(), BreakIterator::IS_WORD_BREAK);
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
// Finds the space, and the Khmer characters.
|
||||
EXPECT_EQ(base::UTF8ToUTF16(" "), iter.GetString());
|
||||
EXPECT_EQ(u" ", iter.GetString());
|
||||
EXPECT_EQ(iter.GetWordBreakStatus(), BreakIterator::IS_SKIPPABLE_WORD);
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
EXPECT_EQ(u"\x1791\x17C1", iter.GetString());
|
||||
EXPECT_EQ(iter.GetWordBreakStatus(), BreakIterator::IS_WORD_BREAK);
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
// Finds the space and the newline.
|
||||
EXPECT_EQ(base::UTF8ToUTF16(" "), iter.GetString());
|
||||
EXPECT_EQ(u" ", iter.GetString());
|
||||
EXPECT_EQ(iter.GetWordBreakStatus(), BreakIterator::IS_SKIPPABLE_WORD);
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
EXPECT_EQ(base::UTF8ToUTF16("\n"), iter.GetString());
|
||||
EXPECT_EQ(iter.GetWordBreakStatus(), BreakIterator::IS_SKIPPABLE_WORD);
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
// Finds "Can".
|
||||
EXPECT_EQ(base::UTF8ToUTF16("Can"), iter.GetString());
|
||||
EXPECT_EQ(u"Can", iter.GetString());
|
||||
EXPECT_EQ(iter.GetWordBreakStatus(), BreakIterator::IS_WORD_BREAK);
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
// Finds the space and the Russian characters.
|
||||
EXPECT_EQ(base::UTF8ToUTF16(" "), iter.GetString());
|
||||
EXPECT_EQ(u" ", iter.GetString());
|
||||
EXPECT_EQ(iter.GetWordBreakStatus(), BreakIterator::IS_SKIPPABLE_WORD);
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
EXPECT_EQ(u"\x041C\x0438", iter.GetString());
|
||||
EXPECT_EQ(iter.GetWordBreakStatus(), BreakIterator::IS_WORD_BREAK);
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
// Finds the trailing periods.
|
||||
EXPECT_EQ(base::UTF8ToUTF16("."), iter.GetString());
|
||||
EXPECT_EQ(u".", iter.GetString());
|
||||
EXPECT_EQ(iter.GetWordBreakStatus(), BreakIterator::IS_SKIPPABLE_WORD);
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
EXPECT_EQ(base::UTF8ToUTF16("."), iter.GetString());
|
||||
EXPECT_EQ(u".", iter.GetString());
|
||||
EXPECT_EQ(iter.GetWordBreakStatus(), BreakIterator::IS_SKIPPABLE_WORD);
|
||||
EXPECT_TRUE(iter.Advance());
|
||||
EXPECT_EQ(base::UTF8ToUTF16("."), iter.GetString());
|
||||
EXPECT_EQ(u".", iter.GetString());
|
||||
EXPECT_EQ(iter.GetWordBreakStatus(), BreakIterator::IS_SKIPPABLE_WORD);
|
||||
EXPECT_FALSE(iter.Advance());
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ TEST(TimeFormattingTest, TimeFormatTimeOfDayDE) {
|
||||
Time time;
|
||||
EXPECT_TRUE(Time::FromUTCExploded(kTestDateTimeExploded, &time));
|
||||
std::u16string clock24h(ASCIIToUTF16("15:42"));
|
||||
std::u16string clock12h_pm(UTF8ToUTF16("3:42 PM"));
|
||||
std::u16string clock12h_pm(u"3:42 PM");
|
||||
std::u16string clock12h(ASCIIToUTF16("3:42"));
|
||||
|
||||
// The default is 24h clock.
|
||||
|
@ -545,11 +545,11 @@ TEST(Erase, String) {
|
||||
TEST(Erase, String16) {
|
||||
std::pair<std::u16string, std::u16string> test_data[] = {
|
||||
{std::u16string(), std::u16string()},
|
||||
{UTF8ToUTF16("abc"), UTF8ToUTF16("bc")},
|
||||
{UTF8ToUTF16("abca"), UTF8ToUTF16("bc")},
|
||||
{u"abc", u"bc"},
|
||||
{u"abca", u"bc"},
|
||||
};
|
||||
|
||||
const std::u16string letters = UTF8ToUTF16("ab");
|
||||
const std::u16string letters = u"ab";
|
||||
for (auto test_case : test_data) {
|
||||
Erase(test_case.first, letters[0]);
|
||||
EXPECT_EQ(test_case.second, test_case.first);
|
||||
|
@ -37,10 +37,8 @@ TEST(StringUtilTest, MatchPatternTest) {
|
||||
EXPECT_FALSE(MatchPattern("\xf4\x90\x80\x80", "\xf4\x90\x80\x80"));
|
||||
|
||||
// Test UTF16 character matching.
|
||||
EXPECT_TRUE(MatchPattern(UTF8ToUTF16("www.google.com"),
|
||||
UTF8ToUTF16("*.com")));
|
||||
EXPECT_TRUE(MatchPattern(UTF8ToUTF16("Hello*1234"),
|
||||
UTF8ToUTF16("He??o\\*1*")));
|
||||
EXPECT_TRUE(MatchPattern(u"www.google.com", u"*.com"));
|
||||
EXPECT_TRUE(MatchPattern(u"Hello*1234", UTF8ToUTF16("He??o\\*1*")));
|
||||
|
||||
// Some test cases that might cause naive implementations to exhibit
|
||||
// exponential run time or fail.
|
||||
|
@ -1245,7 +1245,7 @@ TEST(ValuesTest, SetStringPath) {
|
||||
|
||||
ASSERT_TRUE(root.SetStringPath("foo.bar", StringPiece("rah rah")));
|
||||
ASSERT_TRUE(root.SetStringPath("foo.bar", std::string("temp string")));
|
||||
ASSERT_TRUE(root.SetStringPath("foo.bar", UTF8ToUTF16("temp string")));
|
||||
ASSERT_TRUE(root.SetStringPath("foo.bar", u"temp string"));
|
||||
|
||||
// Can't change existing non-dictionary keys.
|
||||
ASSERT_FALSE(root.SetStringPath("foo.bar.zoo", "ola mundo"));
|
||||
|
@ -84,7 +84,7 @@ class ContextualSearchDelegateTest : public testing::Test {
|
||||
}
|
||||
|
||||
void CreateDefaultSearchContextAndRequestSearchTerm() {
|
||||
std::u16string surrounding = base::UTF8ToUTF16("Barack Obama just spoke.");
|
||||
std::u16string surrounding = u"Barack Obama just spoke.";
|
||||
CreateSearchContextAndRequestSearchTerm("Barack Obama", surrounding, 0, 6);
|
||||
}
|
||||
|
||||
@ -401,7 +401,7 @@ TEST_F(ContextualSearchDelegateTest, InvalidResponse) {
|
||||
}
|
||||
|
||||
TEST_F(ContextualSearchDelegateTest, ExpandSelectionToEnd) {
|
||||
std::u16string surrounding = base::UTF8ToUTF16("Barack Obama just spoke.");
|
||||
std::u16string surrounding = u"Barack Obama just spoke.";
|
||||
std::string selected_text = "Barack";
|
||||
CreateSearchContextAndRequestSearchTerm(selected_text, surrounding, 0, 6);
|
||||
SetResponseStringAndSimulateResponse(selected_text, "0", "12");
|
||||
@ -411,7 +411,7 @@ TEST_F(ContextualSearchDelegateTest, ExpandSelectionToEnd) {
|
||||
}
|
||||
|
||||
TEST_F(ContextualSearchDelegateTest, ExpandSelectionToStart) {
|
||||
std::u16string surrounding = base::UTF8ToUTF16("Barack Obama just spoke.");
|
||||
std::u16string surrounding = u"Barack Obama just spoke.";
|
||||
std::string selected_text = "Obama";
|
||||
CreateSearchContextAndRequestSearchTerm(selected_text, surrounding, 7, 12);
|
||||
SetResponseStringAndSimulateResponse(selected_text, "0", "12");
|
||||
@ -421,7 +421,7 @@ TEST_F(ContextualSearchDelegateTest, ExpandSelectionToStart) {
|
||||
}
|
||||
|
||||
TEST_F(ContextualSearchDelegateTest, ExpandSelectionBothDirections) {
|
||||
std::u16string surrounding = base::UTF8ToUTF16("Barack Obama just spoke.");
|
||||
std::u16string surrounding = u"Barack Obama just spoke.";
|
||||
std::string selected_text = "Ob";
|
||||
CreateSearchContextAndRequestSearchTerm(selected_text, surrounding, 7, 9);
|
||||
SetResponseStringAndSimulateResponse(selected_text, "0", "12");
|
||||
@ -431,7 +431,7 @@ TEST_F(ContextualSearchDelegateTest, ExpandSelectionBothDirections) {
|
||||
}
|
||||
|
||||
TEST_F(ContextualSearchDelegateTest, ExpandSelectionInvalidRange) {
|
||||
std::u16string surrounding = base::UTF8ToUTF16("Barack Obama just spoke.");
|
||||
std::u16string surrounding = u"Barack Obama just spoke.";
|
||||
std::string selected_text = "Ob";
|
||||
CreateSearchContextAndRequestSearchTerm(selected_text, surrounding, 7, 9);
|
||||
SetResponseStringAndSimulateResponse(selected_text, "0", "1001");
|
||||
@ -441,7 +441,7 @@ TEST_F(ContextualSearchDelegateTest, ExpandSelectionInvalidRange) {
|
||||
}
|
||||
|
||||
TEST_F(ContextualSearchDelegateTest, ExpandSelectionInvalidDistantStart) {
|
||||
std::u16string surrounding = base::UTF8ToUTF16("Barack Obama just spoke.");
|
||||
std::u16string surrounding = u"Barack Obama just spoke.";
|
||||
std::string selected_text = "Ob";
|
||||
CreateSearchContextAndRequestSearchTerm(selected_text, surrounding,
|
||||
0xffffffff, 0xffffffff - 2);
|
||||
@ -452,7 +452,7 @@ TEST_F(ContextualSearchDelegateTest, ExpandSelectionInvalidDistantStart) {
|
||||
}
|
||||
|
||||
TEST_F(ContextualSearchDelegateTest, ExpandSelectionInvalidNoOverlap) {
|
||||
std::u16string surrounding = base::UTF8ToUTF16("Barack Obama just spoke.");
|
||||
std::u16string surrounding = u"Barack Obama just spoke.";
|
||||
std::string selected_text = "Ob";
|
||||
CreateSearchContextAndRequestSearchTerm(selected_text, surrounding, 0, 12);
|
||||
SetResponseStringAndSimulateResponse(selected_text, "12", "14");
|
||||
@ -462,7 +462,7 @@ TEST_F(ContextualSearchDelegateTest, ExpandSelectionInvalidNoOverlap) {
|
||||
}
|
||||
|
||||
TEST_F(ContextualSearchDelegateTest, ExpandSelectionInvalidDistantEndAndRange) {
|
||||
std::u16string surrounding = base::UTF8ToUTF16("Barack Obama just spoke.");
|
||||
std::u16string surrounding = u"Barack Obama just spoke.";
|
||||
std::string selected_text = "Ob";
|
||||
CreateSearchContextAndRequestSearchTerm(selected_text, surrounding,
|
||||
0xffffffff, 0xffffffff - 2);
|
||||
@ -473,7 +473,7 @@ TEST_F(ContextualSearchDelegateTest, ExpandSelectionInvalidDistantEndAndRange) {
|
||||
}
|
||||
|
||||
TEST_F(ContextualSearchDelegateTest, ExpandSelectionLargeNumbers) {
|
||||
std::u16string surrounding = base::UTF8ToUTF16("Barack Obama just spoke.");
|
||||
std::u16string surrounding = u"Barack Obama just spoke.";
|
||||
std::string selected_text = "Ob";
|
||||
CreateSearchContextAndRequestSearchTerm(selected_text, surrounding,
|
||||
268435450, 268435455);
|
||||
@ -484,7 +484,7 @@ TEST_F(ContextualSearchDelegateTest, ExpandSelectionLargeNumbers) {
|
||||
}
|
||||
|
||||
TEST_F(ContextualSearchDelegateTest, ContractSelectionValid) {
|
||||
std::u16string surrounding = base::UTF8ToUTF16("Barack Obama just spoke.");
|
||||
std::u16string surrounding = u"Barack Obama just spoke.";
|
||||
std::string selected_text = "Barack Obama just";
|
||||
CreateSearchContextAndRequestSearchTerm(selected_text, surrounding, 0, 17);
|
||||
SetResponseStringAndSimulateResponse(selected_text, "0", "12");
|
||||
@ -494,7 +494,7 @@ TEST_F(ContextualSearchDelegateTest, ContractSelectionValid) {
|
||||
}
|
||||
|
||||
TEST_F(ContextualSearchDelegateTest, ContractSelectionInvalid) {
|
||||
std::u16string surrounding = base::UTF8ToUTF16("Barack Obama just spoke.");
|
||||
std::u16string surrounding = u"Barack Obama just spoke.";
|
||||
std::string selected_text = "Barack Obama just";
|
||||
CreateSearchContextAndRequestSearchTerm(selected_text, surrounding, 0, 17);
|
||||
SetResponseStringAndSimulateResponse(selected_text, "5", "5");
|
||||
|
@ -115,7 +115,8 @@ std::string DeltaFileEntryWithData::Url() const {
|
||||
}
|
||||
|
||||
std::u16string DeltaFileEntryWithData::Title() const {
|
||||
if (!Valid()) return base::UTF8ToUTF16("");
|
||||
if (!Valid())
|
||||
return u"";
|
||||
if (is_bookmark_ && !bookmark_title_.empty()) return bookmark_title_;
|
||||
if (data_.title().empty()) return base::UTF8ToUTF16(data_.url().host_piece());
|
||||
return data_.title();
|
||||
|
@ -98,32 +98,32 @@ TEST_F(DeltaFileEntryWithDataTest, BookmarkScore) {
|
||||
|
||||
TEST_F(DeltaFileEntryWithDataTest, NoBookmarkEmptyTitle) {
|
||||
history::URLRow row(GURL("http://www.host.org/path?query=param"));
|
||||
row.set_title(base::UTF8ToUTF16(""));
|
||||
row.set_title(u"");
|
||||
row.set_hidden(false);
|
||||
data_.SetData(row);
|
||||
EXPECT_TRUE(data_.Valid());
|
||||
EXPECT_EQ(base::UTF8ToUTF16("www.host.org"), data_.Title());
|
||||
EXPECT_EQ(u"www.host.org", data_.Title());
|
||||
}
|
||||
|
||||
TEST_F(DeltaFileEntryWithDataTest, NoBookmarkNonEmptyTitle) {
|
||||
history::URLRow row(GURL("http://host.org/path?query=param"));
|
||||
row.set_title(base::UTF8ToUTF16("title"));
|
||||
row.set_title(u"title");
|
||||
row.set_hidden(false);
|
||||
data_.SetData(row);
|
||||
EXPECT_TRUE(data_.Valid());
|
||||
EXPECT_EQ(base::UTF8ToUTF16("title"), data_.Title());
|
||||
EXPECT_EQ(u"title", data_.Title());
|
||||
}
|
||||
|
||||
TEST_F(DeltaFileEntryWithDataTest, BookmarkTitle) {
|
||||
UrlAndTitle bookmark;
|
||||
bookmark.title = base::UTF8ToUTF16("bookmark_title");
|
||||
bookmark.title = u"bookmark_title";
|
||||
history::URLRow row(GURL("http://host.org/path?query=param"));
|
||||
row.set_title(base::UTF8ToUTF16("title"));
|
||||
row.set_title(u"title");
|
||||
row.set_hidden(false);
|
||||
data_.SetData(row);
|
||||
data_.MarkAsBookmark(bookmark);
|
||||
EXPECT_TRUE(data_.Valid());
|
||||
EXPECT_EQ(base::UTF8ToUTF16("bookmark_title"), data_.Title());
|
||||
EXPECT_EQ(u"bookmark_title", data_.Title());
|
||||
}
|
||||
|
||||
TEST_F(DeltaFileEntryWithDataTest, TrimWWWPrefix) {
|
||||
|
@ -1130,7 +1130,7 @@ IN_PROC_BROWSER_TEST_F(WebViewInteractiveTest, MAYBE_Focus_InputMethod) {
|
||||
// user input via IME.
|
||||
{
|
||||
ui::CompositionText composition;
|
||||
composition.text = base::UTF8ToUTF16("InputTest123");
|
||||
composition.text = u"InputTest123";
|
||||
text_input_client->SetCompositionText(composition);
|
||||
EXPECT_TRUE(content::ExecuteScript(
|
||||
embedder_web_contents,
|
||||
@ -1145,7 +1145,7 @@ IN_PROC_BROWSER_TEST_F(WebViewInteractiveTest, MAYBE_Focus_InputMethod) {
|
||||
next_step_listener.Reset();
|
||||
|
||||
ui::CompositionText composition;
|
||||
composition.text = base::UTF8ToUTF16("InputTest456");
|
||||
composition.text = u"InputTest456";
|
||||
text_input_client->SetCompositionText(composition);
|
||||
text_input_client->ConfirmCompositionText(/* keep_selection */ false);
|
||||
EXPECT_TRUE(content::ExecuteScript(
|
||||
@ -1526,9 +1526,9 @@ IN_PROC_BROWSER_TEST_F(WebViewImeInteractiveTest,
|
||||
false);
|
||||
content::RenderWidgetHost* target_rwh_for_input =
|
||||
target_web_contents->GetRenderWidgetHostView()->GetRenderWidgetHost();
|
||||
content::SendImeCommitTextToWidget(
|
||||
target_rwh_for_input, base::UTF8ToUTF16("C"),
|
||||
std::vector<ui::ImeTextSpan>(), gfx::Range(4, 5), 0);
|
||||
content::SendImeCommitTextToWidget(target_rwh_for_input, u"C",
|
||||
std::vector<ui::ImeTextSpan>(),
|
||||
gfx::Range(4, 5), 0);
|
||||
EXPECT_TRUE(input_listener.WaitUntilSatisfied());
|
||||
|
||||
// Get the input value from the guest.
|
||||
@ -1593,8 +1593,7 @@ IN_PROC_BROWSER_TEST_F(WebViewImeInteractiveTest, CompositionRangeUpdates) {
|
||||
CompositionRangeUpdateObserver observer(embedder_web_contents);
|
||||
content::SendImeSetCompositionTextToWidget(
|
||||
target_web_contents->GetRenderWidgetHostView()->GetRenderWidgetHost(),
|
||||
base::UTF8ToUTF16("ABC"), std::vector<ui::ImeTextSpan>(),
|
||||
gfx::Range::InvalidRange(), 0, 3);
|
||||
u"ABC", std::vector<ui::ImeTextSpan>(), gfx::Range::InvalidRange(), 0, 3);
|
||||
observer.WaitForCompositionRangeLength(3U);
|
||||
}
|
||||
|
||||
|
@ -208,9 +208,8 @@ class ArcAccessibilityHelperBridgeTest : public ChromeViewsTestBase {
|
||||
|
||||
std::unique_ptr<message_center::Notification> CreateNotification() {
|
||||
auto notification = std::make_unique<message_center::Notification>(
|
||||
message_center::NOTIFICATION_TYPE_CUSTOM, kNotificationKey,
|
||||
base::UTF8ToUTF16("title"), base::UTF8ToUTF16("message"), gfx::Image(),
|
||||
base::UTF8ToUTF16("display_source"), GURL(),
|
||||
message_center::NOTIFICATION_TYPE_CUSTOM, kNotificationKey, u"title",
|
||||
u"message", gfx::Image(), u"display_source", GURL(),
|
||||
message_center::NotifierId(
|
||||
message_center::NotifierType::ARC_APPLICATION, "test_app_id"),
|
||||
message_center::RichNotificationData(), nullptr);
|
||||
|
@ -62,7 +62,7 @@ TEST_F(ArcAppShortcutsMenuBuilderTest, Basic) {
|
||||
base::RunLoop run_loop;
|
||||
std::unique_ptr<ui::SimpleMenuModel> menu;
|
||||
auto simple_menu_model = std::make_unique<ui::SimpleMenuModel>(nullptr);
|
||||
const std::u16string first_item_label = base::UTF8ToUTF16("FirstItemLabel");
|
||||
const std::u16string first_item_label = u"FirstItemLabel";
|
||||
simple_menu_model->AddItem(1, first_item_label);
|
||||
auto arc_app_shortcuts_menu_builder =
|
||||
std::make_unique<ArcAppShortcutsMenuBuilder>(
|
||||
|
@ -196,8 +196,7 @@ std::vector<ash::LocaleInfo> GetSupportedLocales() {
|
||||
l10n_util::GetDisplayNameForLocale(locale, locale,
|
||||
true /* is_for_ui */);
|
||||
if (locale_info.display_name != native_display_name) {
|
||||
locale_info.display_name +=
|
||||
base::UTF8ToUTF16(" - ") + native_display_name;
|
||||
locale_info.display_name += u" - " + native_display_name;
|
||||
}
|
||||
supported_locales.push_back(std::move(locale_info));
|
||||
}
|
||||
|
@ -420,7 +420,7 @@ IN_PROC_BROWSER_TEST_F(SamlTest, IdpRequiresHttpAuth) {
|
||||
LoginHandler* handler = *login_prompt_observer.handlers().begin();
|
||||
// Note that the actual credentials don't matter because `fake_saml_idp()`
|
||||
// doesn't check those (only that something has been provided).
|
||||
handler->SetAuth(base::UTF8ToUTF16("user"), base::UTF8ToUTF16("pwd"));
|
||||
handler->SetAuth(u"user", u"pwd");
|
||||
|
||||
// Now the SAML sign-in form should actually load.
|
||||
std::string message;
|
||||
|
@ -22,7 +22,7 @@ CreateWebAppInfoForDiagnosticsSystemWebApp() {
|
||||
info->scope = GURL(chromeos::kChromeUIDiagnosticsAppUrl);
|
||||
|
||||
// TODO(jimmyxgong): Update the title with finalized i18n copy.
|
||||
info->title = base::UTF8ToUTF16("Diagnostics");
|
||||
info->title = u"Diagnostics";
|
||||
web_app::CreateIconInfoForSystemWebApp(
|
||||
info->start_url, {{"app_icon_192.png", 192, IDR_DIAGNOSTICS_APP_ICON}},
|
||||
*info);
|
||||
|
@ -21,7 +21,7 @@ std::unique_ptr<WebApplicationInfo> CreateWebAppInfoForEcheApp() {
|
||||
info->scope = GURL(chromeos::eche_app::kChromeUIEcheAppURL);
|
||||
// |title| should come from a resource string, but this is the Eche app, and
|
||||
// doesn't have one.
|
||||
info->title = base::UTF8ToUTF16("Eche App");
|
||||
info->title = u"Eche App";
|
||||
web_app::CreateIconInfoForSystemWebApp(
|
||||
info->start_url,
|
||||
{{"app_icon_256.png", 256, IDR_CHROMEOS_ECHE_APP_ICON_256_PNG}}, *info);
|
||||
|
@ -19,7 +19,7 @@ std::unique_ptr<WebApplicationInfo> CreateWebAppInfoForFileManager() {
|
||||
info->start_url = GURL(chromeos::file_manager::kChromeUIFileManagerURL);
|
||||
info->scope = GURL(chromeos::file_manager::kChromeUIFileManagerURL);
|
||||
// TODO(majewski): Fetch from a resource.
|
||||
info->title = base::UTF8ToUTF16("File Manager");
|
||||
info->title = u"File Manager";
|
||||
web_app::CreateIconInfoForSystemWebApp(
|
||||
info->start_url, {{"icon192.png", 192, IDR_FILE_MANAGER_SWA_ICON_192}},
|
||||
*info);
|
||||
|
@ -78,7 +78,7 @@ std::unique_ptr<WebApplicationInfo> CreateWebAppInfoForMediaWebApp() {
|
||||
|
||||
blink::Manifest::FileHandler file_handler;
|
||||
file_handler.action = GURL(chromeos::kChromeUIMediaAppURL);
|
||||
file_handler.name = base::UTF8ToUTF16("Media File");
|
||||
file_handler.name = u"Media File";
|
||||
file_handler.accept = MakeHandlerAccept();
|
||||
info->file_handlers.push_back(std::move(file_handler));
|
||||
return info;
|
||||
|
@ -21,7 +21,7 @@ std::unique_ptr<WebApplicationInfo> CreateWebAppInfoForSampleSystemWebApp() {
|
||||
info->scope = GURL(chromeos::kChromeUISampleSystemWebAppURL);
|
||||
// |title| should come from a resource string, but this is the sample app, and
|
||||
// doesn't have one.
|
||||
info->title = base::UTF8ToUTF16("Sample System Web App");
|
||||
info->title = u"Sample System Web App";
|
||||
web_app::CreateIconInfoForSystemWebApp(
|
||||
info->start_url,
|
||||
{{"app_icon_192.png", 192,
|
||||
|
@ -112,8 +112,7 @@ IN_PROC_BROWSER_TEST_P(TelemetryExtensionWithDirIntegrationTest,
|
||||
content::NavigateToURL(web_contents, load_from_disk_resource_gurl));
|
||||
|
||||
// Verify that the file loaded from disk has the expected title.
|
||||
EXPECT_EQ(base::UTF8ToUTF16("TelemetryExtension - Loaded From Disk"),
|
||||
web_contents->GetTitle());
|
||||
EXPECT_EQ(u"TelemetryExtension - Loaded From Disk", web_contents->GetTitle());
|
||||
}
|
||||
|
||||
// Tests that TelemetryExtensionUntrustedSource fails to load non-existing
|
||||
|
@ -17,7 +17,7 @@ std::unique_ptr<WebApplicationInfo> CreateWebAppInfoForTelemetryExtension() {
|
||||
auto info = std::make_unique<WebApplicationInfo>();
|
||||
info->start_url = GURL(chromeos::kChromeUITelemetryExtensionURL);
|
||||
info->scope = GURL(chromeos::kChromeUITelemetryExtensionURL);
|
||||
info->title = base::UTF8ToUTF16("Telemetry Extension");
|
||||
info->title = u"Telemetry Extension";
|
||||
web_app::CreateIconInfoForSystemWebApp(
|
||||
info->start_url,
|
||||
{{"app_icon_96.png", 96, IDR_TELEMETRY_EXTENSION_ICON_96}}, *info);
|
||||
|
@ -205,9 +205,8 @@ class BackgroundModeManagerTest : public testing::Test {
|
||||
std::vector<policy::ConfigurationPolicyProvider*>{&policy_provider_});
|
||||
profile_manager_ = CreateTestingProfileManager();
|
||||
profile_ = profile_manager_->CreateTestingProfile(
|
||||
"p1", nullptr, base::UTF8ToUTF16("p1"), 0, "",
|
||||
TestingProfile::TestingFactories(), base::nullopt,
|
||||
std::move(policy_service));
|
||||
"p1", nullptr, u"p1", 0, "", TestingProfile::TestingFactories(),
|
||||
base::nullopt, std::move(policy_service));
|
||||
}
|
||||
|
||||
protected:
|
||||
|
@ -194,7 +194,7 @@ TEST_F(CertificateManagerModelTest, ListsClientCertsFromPlatform) {
|
||||
ASSERT_TRUE(platform_cert_info);
|
||||
|
||||
EXPECT_EQ(net::CertType::USER_CERT, platform_cert_info->type());
|
||||
EXPECT_EQ(base::UTF8ToUTF16("Client Cert A"), platform_cert_info->name());
|
||||
EXPECT_EQ(u"Client Cert A", platform_cert_info->name());
|
||||
EXPECT_TRUE(platform_cert_info->can_be_deleted());
|
||||
EXPECT_EQ(CertificateManagerModel::CertInfo::Source::kPlatform,
|
||||
platform_cert_info->source());
|
||||
@ -368,7 +368,7 @@ TEST_F(CertificateManagerModelChromeOSTest, ListsWebTrustedCertsFromPolicy) {
|
||||
ASSERT_TRUE(cert_info);
|
||||
|
||||
EXPECT_EQ(net::CertType::CA_CERT, cert_info->type());
|
||||
EXPECT_EQ(base::UTF8ToUTF16("pywebsocket"), cert_info->name());
|
||||
EXPECT_EQ(u"pywebsocket", cert_info->name());
|
||||
EXPECT_FALSE(cert_info->can_be_deleted());
|
||||
EXPECT_FALSE(cert_info->untrusted());
|
||||
EXPECT_EQ(CertificateManagerModel::CertInfo::Source::kPolicy,
|
||||
@ -395,7 +395,7 @@ TEST_F(CertificateManagerModelChromeOSTest, ListsNotWebTrustedCertsFromPolicy) {
|
||||
ASSERT_TRUE(cert_info);
|
||||
|
||||
EXPECT_EQ(net::CertType::CA_CERT, cert_info->type());
|
||||
EXPECT_EQ(base::UTF8ToUTF16("pywebsocket"), cert_info->name());
|
||||
EXPECT_EQ(u"pywebsocket", cert_info->name());
|
||||
EXPECT_FALSE(cert_info->can_be_deleted());
|
||||
EXPECT_FALSE(cert_info->untrusted());
|
||||
EXPECT_EQ(CertificateManagerModel::CertInfo::Source::kPolicy,
|
||||
@ -439,7 +439,7 @@ TEST_F(CertificateManagerModelChromeOSTest,
|
||||
EXPECT_EQ(platform_cert_info, policy_cert_info);
|
||||
|
||||
EXPECT_EQ(net::CertType::CA_CERT, policy_cert_info->type());
|
||||
EXPECT_EQ(base::UTF8ToUTF16("pywebsocket"), policy_cert_info->name());
|
||||
EXPECT_EQ(u"pywebsocket", policy_cert_info->name());
|
||||
EXPECT_FALSE(policy_cert_info->can_be_deleted());
|
||||
EXPECT_FALSE(policy_cert_info->untrusted());
|
||||
EXPECT_EQ(CertificateManagerModel::CertInfo::Source::kPolicy,
|
||||
@ -462,7 +462,7 @@ TEST_F(CertificateManagerModelChromeOSTest,
|
||||
ASSERT_TRUE(platform_cert_info);
|
||||
|
||||
EXPECT_EQ(net::CertType::CA_CERT, platform_cert_info->type());
|
||||
EXPECT_EQ(base::UTF8ToUTF16("pywebsocket"), platform_cert_info->name());
|
||||
EXPECT_EQ(u"pywebsocket", platform_cert_info->name());
|
||||
EXPECT_TRUE(platform_cert_info->can_be_deleted());
|
||||
EXPECT_TRUE(platform_cert_info->untrusted());
|
||||
EXPECT_EQ(CertificateManagerModel::CertInfo::Source::kPlatform,
|
||||
@ -507,7 +507,7 @@ TEST_F(CertificateManagerModelChromeOSTest,
|
||||
EXPECT_EQ(platform_cert_info, policy_cert_info);
|
||||
|
||||
EXPECT_EQ(net::CertType::CA_CERT, platform_cert_info->type());
|
||||
EXPECT_EQ(base::UTF8ToUTF16("pywebsocket"), platform_cert_info->name());
|
||||
EXPECT_EQ(u"pywebsocket", platform_cert_info->name());
|
||||
EXPECT_TRUE(platform_cert_info->can_be_deleted());
|
||||
EXPECT_TRUE(platform_cert_info->untrusted());
|
||||
EXPECT_EQ(CertificateManagerModel::CertInfo::Source::kPlatform,
|
||||
@ -532,7 +532,7 @@ TEST_F(CertificateManagerModelChromeOSTest,
|
||||
ASSERT_TRUE(policy_cert_info);
|
||||
|
||||
EXPECT_EQ(net::CertType::CA_CERT, policy_cert_info->type());
|
||||
EXPECT_EQ(base::UTF8ToUTF16("pywebsocket"), policy_cert_info->name());
|
||||
EXPECT_EQ(u"pywebsocket", policy_cert_info->name());
|
||||
EXPECT_FALSE(policy_cert_info->can_be_deleted());
|
||||
EXPECT_FALSE(policy_cert_info->untrusted());
|
||||
EXPECT_EQ(CertificateManagerModel::CertInfo::Source::kPolicy,
|
||||
@ -594,8 +594,7 @@ TEST_F(CertificateManagerModelChromeOSTest, ListsExtensionCerts) {
|
||||
ASSERT_TRUE(extension_cert_info);
|
||||
|
||||
EXPECT_EQ(net::CertType::USER_CERT, extension_cert_info->type());
|
||||
EXPECT_EQ(base::UTF8ToUTF16("Client Cert A (extension provided)"),
|
||||
extension_cert_info->name());
|
||||
EXPECT_EQ(u"Client Cert A (extension provided)", extension_cert_info->name());
|
||||
EXPECT_FALSE(extension_cert_info->can_be_deleted());
|
||||
EXPECT_EQ(CertificateManagerModel::CertInfo::Source::kExtension,
|
||||
extension_cert_info->source());
|
||||
@ -632,7 +631,7 @@ TEST_F(CertificateManagerModelChromeOSTest,
|
||||
EXPECT_EQ(platform_cert_info, extension_cert_info);
|
||||
|
||||
EXPECT_EQ(net::CertType::USER_CERT, platform_cert_info->type());
|
||||
EXPECT_EQ(base::UTF8ToUTF16("Client Cert A"), platform_cert_info->name());
|
||||
EXPECT_EQ(u"Client Cert A", platform_cert_info->name());
|
||||
EXPECT_TRUE(platform_cert_info->can_be_deleted());
|
||||
EXPECT_EQ(CertificateManagerModel::CertInfo::Source::kPlatform,
|
||||
platform_cert_info->source());
|
||||
@ -656,7 +655,7 @@ TEST_F(CertificateManagerModelChromeOSTest,
|
||||
ASSERT_TRUE(extension_cert_info);
|
||||
|
||||
EXPECT_EQ(net::CertType::USER_CERT, extension_cert_info->type());
|
||||
EXPECT_EQ(base::UTF8ToUTF16("Client Cert A (extension provided)"),
|
||||
EXPECT_EQ(u"Client Cert A (extension provided)",
|
||||
extension_cert_info->name());
|
||||
EXPECT_FALSE(extension_cert_info->can_be_deleted());
|
||||
EXPECT_EQ(CertificateManagerModel::CertInfo::Source::kExtension,
|
||||
|
@ -238,7 +238,7 @@ IN_PROC_BROWSER_TEST_F(ChromeServiceWorkerTest,
|
||||
StartServiceWorkerAndDispatchMessage) {
|
||||
base::RunLoop run_loop;
|
||||
blink::TransferableMessage msg;
|
||||
const std::u16string message_data = base::UTF8ToUTF16("testMessage");
|
||||
const std::u16string message_data = u"testMessage";
|
||||
|
||||
WriteFile(FILE_PATH_LITERAL("sw.js"), "self.onfetch = function(e) {};");
|
||||
WriteFile(FILE_PATH_LITERAL("test.html"), kInstallAndWaitForActivatedPage);
|
||||
|
@ -178,8 +178,7 @@ IN_PROC_BROWSER_TEST_F(ScreenTimeControllerTest, UnlockBedtime) {
|
||||
LogInChildAndSetupClockWithTime("5 Jan 2018 22:00:00 BRT");
|
||||
ScreenLockerTester().Lock();
|
||||
|
||||
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(
|
||||
base::UTF8ToUTF16("BRT"));
|
||||
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(u"BRT");
|
||||
|
||||
// Set new policy.
|
||||
base::Time last_updated = utils::TimeFromString("1 Jan 2018 0:00 BRT");
|
||||
@ -219,8 +218,7 @@ IN_PROC_BROWSER_TEST_F(ScreenTimeControllerTest, OverrideBedtimeWithDuration) {
|
||||
LogInChildAndSetupClockWithTime("5 Jan 2018 20:45:00 PST");
|
||||
ScreenLockerTester().Lock();
|
||||
|
||||
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(
|
||||
base::UTF8ToUTF16("PST"));
|
||||
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(u"PST");
|
||||
|
||||
// Set new policy.
|
||||
base::Time last_updated = utils::TimeFromString("1 Jan 2018 0:00 PST");
|
||||
@ -278,8 +276,7 @@ IN_PROC_BROWSER_TEST_F(ScreenTimeControllerTest,
|
||||
LogInChildAndSetupClockWithTime("1 Jan 2018 10:00:00 BRT");
|
||||
ScreenLockerTester().Lock();
|
||||
|
||||
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(
|
||||
base::UTF8ToUTF16("BRT"));
|
||||
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(u"BRT");
|
||||
|
||||
// Set new policy.
|
||||
base::Time last_updated = utils::TimeFromString("1 Jan 2018 0:00 BRT");
|
||||
@ -331,8 +328,7 @@ IN_PROC_BROWSER_TEST_F(ScreenTimeControllerTest, UnlockBedtimeWithDuration) {
|
||||
LogInChildAndSetupClockWithTime("5 Jan 2018 22:00:00 GMT");
|
||||
ScreenLockerTester().Lock();
|
||||
|
||||
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(
|
||||
base::UTF8ToUTF16("GMT"));
|
||||
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(u"GMT");
|
||||
|
||||
// Set new policy.
|
||||
base::Time last_updated = utils::TimeFromString("1 Jan 2018 0:00 GMT");
|
||||
@ -386,8 +382,7 @@ IN_PROC_BROWSER_TEST_F(ScreenTimeControllerTest, UnlockDailyLimitWithDuration) {
|
||||
LogInChildAndSetupClockWithTime("1 Jan 2018 10:00:00 PST");
|
||||
ScreenLockerTester().Lock();
|
||||
|
||||
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(
|
||||
base::UTF8ToUTF16("PST"));
|
||||
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(u"PST");
|
||||
|
||||
// Set new policy.
|
||||
base::Time last_updated = utils::TimeFromString("1 Jan 2018 0:00 PST");
|
||||
@ -439,8 +434,7 @@ IN_PROC_BROWSER_TEST_F(ScreenTimeControllerTest, DefaultBedtime) {
|
||||
LogInChildAndSetupClockWithTime("1 Jan 2018 10:00:00 GMT");
|
||||
ScreenLockerTester().Lock();
|
||||
|
||||
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(
|
||||
base::UTF8ToUTF16("GMT"));
|
||||
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(u"GMT");
|
||||
|
||||
// Set new policy.
|
||||
base::Time last_updated = utils::TimeFromString("1 Jan 2018 0:00 GMT");
|
||||
@ -497,8 +491,7 @@ IN_PROC_BROWSER_TEST_F(ScreenTimeControllerTest, DISABLED_DefaultDailyLimit) {
|
||||
LogInChildAndSetupClockWithTime("1 Jan 2018 10:00:00 GMT");
|
||||
ScreenLockerTester().Lock();
|
||||
|
||||
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(
|
||||
base::UTF8ToUTF16("GMT"));
|
||||
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(u"GMT");
|
||||
|
||||
// Set new policy.
|
||||
base::Time last_updated = utils::TimeFromString("1 Jan 2018 0:00 GMT");
|
||||
@ -558,8 +551,7 @@ IN_PROC_BROWSER_TEST_F(ScreenTimeControllerTest,
|
||||
DISABLED_ActiveSessionBedtime) {
|
||||
LogInChildAndSetupClockWithTime("1 Jan 2018 10:00:00 PST");
|
||||
|
||||
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(
|
||||
base::UTF8ToUTF16("PST"));
|
||||
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(u"PST");
|
||||
|
||||
// Set new policy.
|
||||
base::Time last_updated = utils::TimeFromString("1 Jan 2018 0:00 PST");
|
||||
@ -592,8 +584,7 @@ IN_PROC_BROWSER_TEST_F(ScreenTimeControllerTest,
|
||||
DISABLED_ActiveSessionDailyLimit) {
|
||||
LogInChildAndSetupClockWithTime("1 Jan 2018 10:00:00 PST");
|
||||
|
||||
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(
|
||||
base::UTF8ToUTF16("PST"));
|
||||
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(u"PST");
|
||||
|
||||
// Set new policy.
|
||||
base::Time last_updated = utils::TimeFromString("1 Jan 2018 0:00 PST");
|
||||
@ -623,8 +614,7 @@ IN_PROC_BROWSER_TEST_F(ScreenTimeControllerTest, BedtimeOnTimezoneChange) {
|
||||
LogInChildAndSetupClockWithTime("3 Jan 2018 10:00:00 GMT-0600");
|
||||
ScreenLockerTester().Lock();
|
||||
|
||||
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(
|
||||
base::UTF8ToUTF16("GMT-0600"));
|
||||
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(u"GMT-0600");
|
||||
|
||||
// Set new policy.
|
||||
base::Time last_updated = utils::TimeFromString("3 Jan 2018 0:00 GMT-0600");
|
||||
@ -648,8 +638,7 @@ IN_PROC_BROWSER_TEST_F(ScreenTimeControllerTest, BedtimeOnTimezoneChange) {
|
||||
|
||||
// Change timezone, so that local time goes back to 6 PM and check that auth
|
||||
// is enabled since bedtime has not started yet.
|
||||
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(
|
||||
base::UTF8ToUTF16("GMT-0700"));
|
||||
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(u"GMT-0700");
|
||||
EXPECT_TRUE(IsAuthEnabled());
|
||||
|
||||
// Verify that auth is disabled at 7 PM (start of bedtime).
|
||||
@ -658,8 +647,7 @@ IN_PROC_BROWSER_TEST_F(ScreenTimeControllerTest, BedtimeOnTimezoneChange) {
|
||||
|
||||
// Change timezone, so that local time goes forward to 7 AM and check that
|
||||
// auth is enabled since bedtime has ended in the new local time.
|
||||
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(
|
||||
base::UTF8ToUTF16("GMT+0500"));
|
||||
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(u"GMT+0500");
|
||||
EXPECT_TRUE(IsAuthEnabled());
|
||||
}
|
||||
|
||||
@ -671,8 +659,7 @@ IN_PROC_BROWSER_TEST_F(ScreenTimeControllerTest, BedtimeLockScreen24HourClock) {
|
||||
|
||||
ScreenLockerTester().Lock();
|
||||
|
||||
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(
|
||||
base::UTF8ToUTF16("GMT"));
|
||||
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(u"GMT");
|
||||
|
||||
// Set new policy.
|
||||
base::Time last_updated = utils::TimeFromString("1 Jan 2018 0:00 GMT");
|
||||
@ -686,7 +673,7 @@ IN_PROC_BROWSER_TEST_F(ScreenTimeControllerTest, BedtimeLockScreen24HourClock) {
|
||||
// Check that auth is disabled, since the bedtime has already started.
|
||||
EXPECT_FALSE(IsAuthEnabled());
|
||||
|
||||
EXPECT_EQ(base::UTF8ToUTF16("Come back at 17:00."),
|
||||
EXPECT_EQ(u"Come back at 17:00.",
|
||||
ash::LoginScreenTestApi::GetDisabledAuthMessage(GetAccountId()));
|
||||
}
|
||||
|
||||
@ -696,8 +683,7 @@ IN_PROC_BROWSER_TEST_F(ScreenTimeControllerTest,
|
||||
LogInChildAndSetupClockWithTime("3 Jan 2018 8:00:00 GMT+1300");
|
||||
ScreenLockerTester().Lock();
|
||||
|
||||
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(
|
||||
base::UTF8ToUTF16("GMT+1300"));
|
||||
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(u"GMT+1300");
|
||||
|
||||
// Set new policy.
|
||||
base::Time last_updated = utils::TimeFromString("3 Jan 2018 0:00 GMT+1300");
|
||||
@ -713,15 +699,13 @@ IN_PROC_BROWSER_TEST_F(ScreenTimeControllerTest,
|
||||
|
||||
// Change timezone so that local time goes back to 6 AM and check that auth is
|
||||
// disable, since the tuesday's bedtime is not over yet.
|
||||
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(
|
||||
base::UTF8ToUTF16("GMT+1100"));
|
||||
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(u"GMT+1100");
|
||||
EXPECT_FALSE(IsAuthEnabled());
|
||||
|
||||
// Change timezone so that local time goes back to 7 PM on Tuesday and check
|
||||
// that auth is enabled, because the bedtime has not started yet in the
|
||||
// new local time.
|
||||
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(
|
||||
base::UTF8ToUTF16("GMT"));
|
||||
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(u"GMT");
|
||||
EXPECT_TRUE(IsAuthEnabled());
|
||||
|
||||
// Verify that auth is disabled at 8 PM (start of bedtime).
|
||||
@ -734,8 +718,7 @@ IN_PROC_BROWSER_TEST_F(ScreenTimeControllerTest,
|
||||
IN_PROC_BROWSER_TEST_F(ScreenTimeControllerTest, DISABLED_CallObservers) {
|
||||
LogInChildAndSetupClockWithTime("1 Jan 2018 10:00:00 PST");
|
||||
|
||||
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(
|
||||
base::UTF8ToUTF16("PST"));
|
||||
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(u"PST");
|
||||
|
||||
// Set new policy with 3 hours of time usage limit.
|
||||
base::Time last_updated = utils::TimeFromString("1 Jan 2018 0:00 PST");
|
||||
|
@ -180,7 +180,7 @@ content::WebContents* WebTimeLimitEnforcerThrottleTest::InstallAndLaunchWebApp(
|
||||
bool allowlisted_app) {
|
||||
auto web_app_info = std::make_unique<WebApplicationInfo>();
|
||||
web_app_info->title = base::UTF8ToUTF16(url.host());
|
||||
web_app_info->description = base::UTF8ToUTF16("Web app");
|
||||
web_app_info->description = u"Web app";
|
||||
web_app_info->start_url = url;
|
||||
web_app_info->scope = url;
|
||||
web_app_info->open_as_window = true;
|
||||
|
@ -48,7 +48,7 @@ std::string GetWebTimeLimitErrorPage(
|
||||
strings.SetString("blockPageHeader", block_header);
|
||||
strings.SetString(
|
||||
"blockPageMessage",
|
||||
base::StrCat({block_message, base::UTF8ToUTF16(" "),
|
||||
base::StrCat({block_message, u" ",
|
||||
l10n_util::GetStringFUTF16(
|
||||
IDS_WEB_TIME_LIMIT_ERROR_PAGE_NEXT_ACCESS_TIME,
|
||||
GetTimeLimitMessage(time_limit))}));
|
||||
|
@ -50,7 +50,7 @@ TEST(FileManagerUrlUtilTest, GetFileManagerMainPageUrl) {
|
||||
|
||||
TEST(FileManagerUrlUtilTest, GetFileManagerMainPageUrlWithParams_NoFileTypes) {
|
||||
const GURL url = GetFileManagerMainPageUrlWithParams(
|
||||
ui::SelectFileDialog::SELECT_OPEN_FILE, base::UTF8ToUTF16("some title"),
|
||||
ui::SelectFileDialog::SELECT_OPEN_FILE, u"some title",
|
||||
GURL("filesystem:chrome-extension://abc/Downloads/"),
|
||||
GURL("filesystem:chrome-extension://abc/Downloads/foo.txt"), "foo.txt",
|
||||
nullptr, // No file types
|
||||
@ -96,15 +96,13 @@ TEST(FileManagerUrlUtilTest,
|
||||
file_types.extensions[0].push_back(FILE_PATH_LITERAL("html"));
|
||||
file_types.extensions.emplace_back();
|
||||
file_types.extensions[1].push_back(FILE_PATH_LITERAL("txt"));
|
||||
file_types.extension_description_overrides.push_back(
|
||||
base::UTF8ToUTF16("HTML"));
|
||||
file_types.extension_description_overrides.push_back(
|
||||
base::UTF8ToUTF16("TEXT"));
|
||||
file_types.extension_description_overrides.push_back(u"HTML");
|
||||
file_types.extension_description_overrides.push_back(u"TEXT");
|
||||
// "shouldReturnLocalPath" will be false if drive is supported.
|
||||
file_types.allowed_paths = ui::SelectFileDialog::FileTypeInfo::ANY_PATH;
|
||||
|
||||
const GURL url = GetFileManagerMainPageUrlWithParams(
|
||||
ui::SelectFileDialog::SELECT_OPEN_FILE, base::UTF8ToUTF16("some title"),
|
||||
ui::SelectFileDialog::SELECT_OPEN_FILE, u"some title",
|
||||
GURL("filesystem:chrome-extension://abc/Downloads/"),
|
||||
GURL("filesystem:chrome-extension://abc/Downloads/foo.txt"), "foo.txt",
|
||||
&file_types,
|
||||
|
@ -1079,16 +1079,14 @@ TEST_F(VolumeManagerTest, MTPPlugAndUnplug) {
|
||||
storage_monitor::StorageInfo info(
|
||||
storage_monitor::StorageInfo::MakeDeviceId(
|
||||
storage_monitor::StorageInfo::MTP_OR_PTP, "dummy-device-id"),
|
||||
FILE_PATH_LITERAL("/dummy/device/location"), base::UTF8ToUTF16("label"),
|
||||
base::UTF8ToUTF16("vendor"), base::UTF8ToUTF16("model"),
|
||||
12345 /* size */);
|
||||
FILE_PATH_LITERAL("/dummy/device/location"), u"label", u"vendor",
|
||||
u"model", 12345 /* size */);
|
||||
|
||||
storage_monitor::StorageInfo non_mtp_info(
|
||||
storage_monitor::StorageInfo::MakeDeviceId(
|
||||
storage_monitor::StorageInfo::FIXED_MASS_STORAGE, "dummy-device-id2"),
|
||||
FILE_PATH_LITERAL("/dummy/device/location2"), base::UTF8ToUTF16("label2"),
|
||||
base::UTF8ToUTF16("vendor2"), base::UTF8ToUTF16("model2"),
|
||||
12345 /* size */);
|
||||
FILE_PATH_LITERAL("/dummy/device/location2"), u"label2", u"vendor2",
|
||||
u"model2", 12345 /* size */);
|
||||
|
||||
// Attach
|
||||
volume_manager()->OnRemovableStorageAttached(info);
|
||||
|
@ -93,7 +93,7 @@ class AssistiveWindowControllerTest : public ChromeAshTestBase {
|
||||
std::unique_ptr<AssistiveWindowController> controller_;
|
||||
std::unique_ptr<MockDelegate> delegate_ = std::make_unique<MockDelegate>();
|
||||
std::unique_ptr<TestingProfile> profile_;
|
||||
const std::u16string suggestion_ = base::UTF8ToUTF16("test");
|
||||
const std::u16string suggestion_ = u"test";
|
||||
ui::ime::AssistiveWindowButton emoji_button_;
|
||||
chromeos::AssistiveWindowProperties emoji_window_;
|
||||
TestTtsHandler* tts_handler_;
|
||||
@ -166,8 +166,7 @@ TEST_F(AssistiveWindowControllerTest,
|
||||
AssistiveWindowProperties properties;
|
||||
properties.type = ui::ime::AssistiveWindowType::kEmojiSuggestion;
|
||||
properties.visible = true;
|
||||
properties.candidates =
|
||||
std::vector<std::u16string>({base::UTF8ToUTF16("candidate")});
|
||||
properties.candidates = std::vector<std::u16string>({u"candidate"});
|
||||
ui::IMEBridge::Get()
|
||||
->GetAssistiveWindowHandler()
|
||||
->SetAssistiveWindowProperties(properties);
|
||||
|
@ -133,9 +133,8 @@ void EmojiSuggester::OnEmojiDataLoaded(const std::string& emoji_data) {
|
||||
std::string word = line.substr(0, comma_pos);
|
||||
std::u16string emojis = base::UTF8ToUTF16(line.substr(comma_pos + 1));
|
||||
// Build emoji_map_ from splitting the string of emojis.
|
||||
emoji_map_[word] =
|
||||
base::SplitString(emojis, base::UTF8ToUTF16(";"), base::TRIM_WHITESPACE,
|
||||
base::SPLIT_WANT_NONEMPTY);
|
||||
emoji_map_[word] = base::SplitString(emojis, u";", base::TRIM_WHITESPACE,
|
||||
base::SPLIT_WANT_NONEMPTY);
|
||||
// TODO(crbug/1093179): Implement arrow to indicate more emojis available.
|
||||
// Only loads 5 emojis for now until arrow is implemented.
|
||||
if (emoji_map_[word].size() > kMaxCandidateSize)
|
||||
|
@ -135,15 +135,15 @@ class EmojiSuggesterTest : public testing::Test {
|
||||
};
|
||||
|
||||
TEST_F(EmojiSuggesterTest, SuggestWhenStringEndsWithSpace) {
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(base::UTF8ToUTF16("happy ")));
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(u"happy "));
|
||||
}
|
||||
|
||||
TEST_F(EmojiSuggesterTest, SuggestWhenStringStartsWithOpenBracket) {
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(base::UTF8ToUTF16("(happy ")));
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(u"(happy "));
|
||||
}
|
||||
|
||||
TEST_F(EmojiSuggesterTest, SuggestWhenStringEndsWithSpaceAndIsUppercase) {
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(base::UTF8ToUTF16("HAPPY ")));
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(u"HAPPY "));
|
||||
}
|
||||
|
||||
TEST_F(EmojiSuggesterTest, DoNotSuggestWhenStringEndsWithNewLine) {
|
||||
@ -151,42 +151,42 @@ TEST_F(EmojiSuggesterTest, DoNotSuggestWhenStringEndsWithNewLine) {
|
||||
}
|
||||
|
||||
TEST_F(EmojiSuggesterTest, DoNotSuggestWhenStringDoesNotEndWithSpace) {
|
||||
EXPECT_FALSE(emoji_suggester_->Suggest(base::UTF8ToUTF16("happy")));
|
||||
EXPECT_FALSE(emoji_suggester_->Suggest(u"happy"));
|
||||
}
|
||||
|
||||
TEST_F(EmojiSuggesterTest, DoNotSuggestWhenWordNotInMap) {
|
||||
EXPECT_FALSE(emoji_suggester_->Suggest(base::UTF8ToUTF16("hapy ")));
|
||||
EXPECT_FALSE(emoji_suggester_->Suggest(u"hapy "));
|
||||
}
|
||||
|
||||
TEST_F(EmojiSuggesterTest, DoNotShowSuggestionWhenVirtualKeyboardEnabled) {
|
||||
chrome_keyboard_controller_client_->set_keyboard_visible_for_test(true);
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(base::UTF8ToUTF16("happy ")));
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(u"happy "));
|
||||
EXPECT_FALSE(emoji_suggester_->GetSuggestionShownForTesting());
|
||||
}
|
||||
|
||||
TEST_F(EmojiSuggesterTest, ReturnkBrowsingWhenPressingDown) {
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(base::UTF8ToUTF16("happy ")));
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(u"happy "));
|
||||
ui::KeyEvent event = CreateKeyEventFromCode(ui::DomCode::ARROW_DOWN);
|
||||
EXPECT_EQ(SuggestionStatus::kBrowsing,
|
||||
emoji_suggester_->HandleKeyEvent(event));
|
||||
}
|
||||
|
||||
TEST_F(EmojiSuggesterTest, ReturnkBrowsingWhenPressingUp) {
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(base::UTF8ToUTF16("happy ")));
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(u"happy "));
|
||||
ui::KeyEvent event = CreateKeyEventFromCode(ui::DomCode::ARROW_UP);
|
||||
EXPECT_EQ(SuggestionStatus::kBrowsing,
|
||||
emoji_suggester_->HandleKeyEvent(event));
|
||||
}
|
||||
|
||||
TEST_F(EmojiSuggesterTest, ReturnkDismissWhenPressingEsc) {
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(base::UTF8ToUTF16("happy ")));
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(u"happy "));
|
||||
ui::KeyEvent event = CreateKeyEventFromCode(ui::DomCode::ESCAPE);
|
||||
EXPECT_EQ(SuggestionStatus::kDismiss,
|
||||
emoji_suggester_->HandleKeyEvent(event));
|
||||
}
|
||||
|
||||
TEST_F(EmojiSuggesterTest, ReturnkNotHandledWhenPressDownThenValidNumber) {
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(base::UTF8ToUTF16("happy ")));
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(u"happy "));
|
||||
ui::KeyEvent event1 = CreateKeyEventFromCode(ui::DomCode::ARROW_DOWN);
|
||||
emoji_suggester_->HandleKeyEvent(event1);
|
||||
ui::KeyEvent event2 = CreateKeyEventFromCode(ui::DomCode::DIGIT1);
|
||||
@ -195,7 +195,7 @@ TEST_F(EmojiSuggesterTest, ReturnkNotHandledWhenPressDownThenValidNumber) {
|
||||
}
|
||||
|
||||
TEST_F(EmojiSuggesterTest, ReturnkNotHandledWhenPressDownThenNotANumber) {
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(base::UTF8ToUTF16("happy ")));
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(u"happy "));
|
||||
ui::KeyEvent event1 = CreateKeyEventFromCode(ui::DomCode::ARROW_DOWN);
|
||||
emoji_suggester_->HandleKeyEvent(event1);
|
||||
ui::KeyEvent event2 = CreateKeyEventFromCode(ui::DomCode::US_A);
|
||||
@ -205,7 +205,7 @@ TEST_F(EmojiSuggesterTest, ReturnkNotHandledWhenPressDownThenNotANumber) {
|
||||
|
||||
TEST_F(EmojiSuggesterTest,
|
||||
ReturnkNotHandledWhenPressingEnterAndACandidateHasNotBeenChosen) {
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(base::UTF8ToUTF16("happy ")));
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(u"happy "));
|
||||
ui::KeyEvent event = CreateKeyEventFromCode(ui::DomCode::ENTER);
|
||||
EXPECT_EQ(SuggestionStatus::kNotHandled,
|
||||
emoji_suggester_->HandleKeyEvent(event));
|
||||
@ -213,7 +213,7 @@ TEST_F(EmojiSuggesterTest,
|
||||
|
||||
TEST_F(EmojiSuggesterTest,
|
||||
ReturnkAcceptWhenPressingEnterAndACandidateHasBeenChosenByPressingDown) {
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(base::UTF8ToUTF16("happy ")));
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(u"happy "));
|
||||
// Press ui::DomCode::ARROW_DOWN to choose a candidate.
|
||||
ui::KeyEvent event1 = CreateKeyEventFromCode(ui::DomCode::ARROW_DOWN);
|
||||
emoji_suggester_->HandleKeyEvent(event1);
|
||||
@ -223,13 +223,13 @@ TEST_F(EmojiSuggesterTest,
|
||||
}
|
||||
|
||||
TEST_F(EmojiSuggesterTest, HighlightFirstCandidateWhenPressingDown) {
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(base::UTF8ToUTF16("happy ")));
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(u"happy "));
|
||||
Press(ui::DomCode::ARROW_DOWN);
|
||||
engine_->VerifyCandidateHighlighted(0, true);
|
||||
}
|
||||
|
||||
TEST_F(EmojiSuggesterTest, HighlightButtonCorrectlyWhenPressingUp) {
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(base::UTF8ToUTF16("happy ")));
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(u"happy "));
|
||||
|
||||
// Go into the window.
|
||||
Press(ui::DomCode::ARROW_DOWN);
|
||||
@ -255,7 +255,7 @@ TEST_F(EmojiSuggesterTest, HighlightButtonCorrectlyWhenPressingUp) {
|
||||
}
|
||||
|
||||
TEST_F(EmojiSuggesterTest, HighlightButtonCorrectlyWhenPressingDown) {
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(base::UTF8ToUTF16("happy ")));
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(u"happy "));
|
||||
|
||||
// Press ui::DomCode::ARROW_DOWN to go through candidates.
|
||||
for (size_t i = 0; i < emoji_suggester_->GetCandidatesSizeForTesting(); i++) {
|
||||
@ -281,7 +281,7 @@ TEST_F(EmojiSuggesterTest, HighlightButtonCorrectlyWhenPressingDown) {
|
||||
|
||||
TEST_F(EmojiSuggesterTest,
|
||||
OpenSettingWhenPressingEnterAndLearnMoreButtonIsChosen) {
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(base::UTF8ToUTF16("happy ")));
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(u"happy "));
|
||||
|
||||
// Go into the window.
|
||||
Press(ui::DomCode::ARROW_DOWN);
|
||||
@ -293,42 +293,42 @@ TEST_F(EmojiSuggesterTest,
|
||||
}
|
||||
|
||||
TEST_F(EmojiSuggesterTest, DoesNotShowIndicesWhenFirstSuggesting) {
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(base::UTF8ToUTF16("happy ")));
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(u"happy "));
|
||||
|
||||
engine_->VerifyShowIndices(false);
|
||||
}
|
||||
|
||||
TEST_F(EmojiSuggesterTest, DoesNotShowIndexAfterPressingDown) {
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(base::UTF8ToUTF16("happy ")));
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(u"happy "));
|
||||
Press(ui::DomCode::ARROW_DOWN);
|
||||
|
||||
engine_->VerifyShowIndices(false);
|
||||
}
|
||||
|
||||
TEST_F(EmojiSuggesterTest, DoesNotShowIndicesAfterGettingSuggestionsTwice) {
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(base::UTF8ToUTF16("happy ")));
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(base::UTF8ToUTF16("happy ")));
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(u"happy "));
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(u"happy "));
|
||||
|
||||
engine_->VerifyShowIndices(false);
|
||||
}
|
||||
|
||||
TEST_F(EmojiSuggesterTest,
|
||||
DoesNotShowIndicesAfterPressingDownThenGetNewSuggestions) {
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(base::UTF8ToUTF16("happy ")));
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(u"happy "));
|
||||
Press(ui::DomCode::ARROW_DOWN);
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(base::UTF8ToUTF16("happy ")));
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(u"happy "));
|
||||
|
||||
engine_->VerifyShowIndices(false);
|
||||
}
|
||||
|
||||
TEST_F(EmojiSuggesterTest, ShowSettingLinkCorrectly) {
|
||||
for (int i = 0; i < kEmojiSuggesterShowSettingMaxCount; i++) {
|
||||
emoji_suggester_->Suggest(base::UTF8ToUTF16("happy "));
|
||||
emoji_suggester_->Suggest(u"happy ");
|
||||
// Dismiss suggestion.
|
||||
Press(ui::DomCode::ESCAPE);
|
||||
engine_->VerifyShowSettingLink(true);
|
||||
}
|
||||
emoji_suggester_->Suggest(base::UTF8ToUTF16("happy "));
|
||||
emoji_suggester_->Suggest(u"happy ");
|
||||
engine_->VerifyShowSettingLink(false);
|
||||
}
|
||||
|
||||
@ -336,7 +336,7 @@ TEST_F(EmojiSuggesterTest, RecordsTimeToAccept) {
|
||||
base::HistogramTester histogram_tester;
|
||||
histogram_tester.ExpectTotalCount("InputMethod.Assistive.TimeToAccept.Emoji",
|
||||
0);
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(base::UTF8ToUTF16("happy ")));
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(u"happy "));
|
||||
// Press ui::DomCode::ARROW_DOWN to choose and accept a candidate.
|
||||
Press(ui::DomCode::ARROW_DOWN);
|
||||
Press(ui::DomCode::ENTER);
|
||||
@ -348,7 +348,7 @@ TEST_F(EmojiSuggesterTest, RecordsTimeToDismiss) {
|
||||
base::HistogramTester histogram_tester;
|
||||
histogram_tester.ExpectTotalCount("InputMethod.Assistive.TimeToDismiss.Emoji",
|
||||
0);
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(base::UTF8ToUTF16("happy ")));
|
||||
EXPECT_TRUE(emoji_suggester_->Suggest(u"happy "));
|
||||
// Press ui::DomCode::ESCAPE to dismiss.
|
||||
Press(ui::DomCode::ESCAPE);
|
||||
histogram_tester.ExpectTotalCount("InputMethod.Assistive.TimeToDismiss.Emoji",
|
||||
|
@ -44,7 +44,7 @@ TEST_F(GrammarServiceClientTest, ReturnsEmptyResultWhenSpellCheckIsDiabled) {
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
||||
client.RequestTextCheck(
|
||||
profile.get(), base::UTF8ToUTF16("cat"),
|
||||
profile.get(), u"cat",
|
||||
base::BindOnce(
|
||||
[](bool success, const std::vector<SpellCheckResult>& results) {
|
||||
EXPECT_FALSE(success);
|
||||
@ -86,7 +86,7 @@ TEST_F(GrammarServiceClientTest, ParsesResults) {
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
||||
client.RequestTextCheck(
|
||||
profile.get(), base::UTF8ToUTF16("fake input"),
|
||||
profile.get(), u"fake input",
|
||||
base::BindOnce(
|
||||
[](bool success, const std::vector<SpellCheckResult>& results) {
|
||||
EXPECT_TRUE(success);
|
||||
@ -95,8 +95,7 @@ TEST_F(GrammarServiceClientTest, ParsesResults) {
|
||||
EXPECT_EQ(results[0].location, 3);
|
||||
EXPECT_EQ(results[0].length, 5);
|
||||
ASSERT_EQ(results[0].replacements.size(), 1U);
|
||||
EXPECT_EQ(results[0].replacements[0],
|
||||
base::UTF8ToUTF16("fake replacement"));
|
||||
EXPECT_EQ(results[0].replacements[0], u"fake replacement");
|
||||
}));
|
||||
|
||||
base::RunLoop().RunUntilIdle();
|
||||
|
@ -235,11 +235,10 @@ IN_PROC_BROWSER_TEST_P(InputMethodEngineBrowserTest,
|
||||
// onSurroundingTextChange should be fired if SetSurroundingText is called.
|
||||
ExtensionTestMessageListener surrounding_text_listener(
|
||||
"onSurroundingTextChanged", false);
|
||||
engine_handler->SetSurroundingText(
|
||||
base::UTF8ToUTF16("text"), // Surrounding text.
|
||||
0, // focused position.
|
||||
1, // anchor position.
|
||||
0); // offset position.
|
||||
engine_handler->SetSurroundingText(u"text", // Surrounding text.
|
||||
0, // focused position.
|
||||
1, // anchor position.
|
||||
0); // offset position.
|
||||
ASSERT_TRUE(surrounding_text_listener.WaitUntilSatisfied());
|
||||
ASSERT_TRUE(surrounding_text_listener.was_satisfied());
|
||||
|
||||
@ -625,7 +624,7 @@ IN_PROC_BROWSER_TEST_P(InputMethodEngineBrowserTest,
|
||||
|
||||
const ui::CompositionText& composition_text =
|
||||
mock_input_context->last_update_composition_arg().composition_text;
|
||||
EXPECT_EQ(base::UTF8ToUTF16("COMPOSITION_TEXT"), composition_text.text);
|
||||
EXPECT_EQ(u"COMPOSITION_TEXT", composition_text.text);
|
||||
const ui::ImeTextSpans ime_text_spans = composition_text.ime_text_spans;
|
||||
|
||||
ASSERT_EQ(2U, ime_text_spans.size());
|
||||
@ -1063,28 +1062,20 @@ IN_PROC_BROWSER_TEST_P(InputMethodEngineBrowserTest,
|
||||
|
||||
ASSERT_EQ(4U, table.candidates().size());
|
||||
|
||||
EXPECT_EQ(base::UTF8ToUTF16("CANDIDATE_1"),
|
||||
table.candidates().at(0).value);
|
||||
EXPECT_EQ(u"CANDIDATE_1", table.candidates().at(0).value);
|
||||
|
||||
EXPECT_EQ(base::UTF8ToUTF16("CANDIDATE_2"),
|
||||
table.candidates().at(1).value);
|
||||
EXPECT_EQ(base::UTF8ToUTF16("LABEL_2"), table.candidates().at(1).label);
|
||||
EXPECT_EQ(u"CANDIDATE_2", table.candidates().at(1).value);
|
||||
EXPECT_EQ(u"LABEL_2", table.candidates().at(1).label);
|
||||
|
||||
EXPECT_EQ(base::UTF8ToUTF16("CANDIDATE_3"),
|
||||
table.candidates().at(2).value);
|
||||
EXPECT_EQ(base::UTF8ToUTF16("LABEL_3"), table.candidates().at(2).label);
|
||||
EXPECT_EQ(base::UTF8ToUTF16("ANNOTACTION_3"),
|
||||
table.candidates().at(2).annotation);
|
||||
EXPECT_EQ(u"CANDIDATE_3", table.candidates().at(2).value);
|
||||
EXPECT_EQ(u"LABEL_3", table.candidates().at(2).label);
|
||||
EXPECT_EQ(u"ANNOTACTION_3", table.candidates().at(2).annotation);
|
||||
|
||||
EXPECT_EQ(base::UTF8ToUTF16("CANDIDATE_4"),
|
||||
table.candidates().at(3).value);
|
||||
EXPECT_EQ(base::UTF8ToUTF16("LABEL_4"), table.candidates().at(3).label);
|
||||
EXPECT_EQ(base::UTF8ToUTF16("ANNOTACTION_4"),
|
||||
table.candidates().at(3).annotation);
|
||||
EXPECT_EQ(base::UTF8ToUTF16("TITLE_4"),
|
||||
table.candidates().at(3).description_title);
|
||||
EXPECT_EQ(base::UTF8ToUTF16("BODY_4"),
|
||||
table.candidates().at(3).description_body);
|
||||
EXPECT_EQ(u"CANDIDATE_4", table.candidates().at(3).value);
|
||||
EXPECT_EQ(u"LABEL_4", table.candidates().at(3).label);
|
||||
EXPECT_EQ(u"ANNOTACTION_4", table.candidates().at(3).annotation);
|
||||
EXPECT_EQ(u"TITLE_4", table.candidates().at(3).description_title);
|
||||
EXPECT_EQ(u"BODY_4", table.candidates().at(3).description_body);
|
||||
}
|
||||
{
|
||||
SCOPED_TRACE("setCursorPosition test");
|
||||
@ -1289,7 +1280,7 @@ IN_PROC_BROWSER_TEST_P(InputMethodEngineBrowserTest,
|
||||
|
||||
const ui::CompositionText& composition_text =
|
||||
mock_input_context->last_update_composition_arg().composition_text;
|
||||
EXPECT_EQ(base::UTF8ToUTF16("us"), composition_text.text);
|
||||
EXPECT_EQ(u"us", composition_text.text);
|
||||
const ui::ImeTextSpans ime_text_spans = composition_text.ime_text_spans;
|
||||
|
||||
ASSERT_EQ(1U, ime_text_spans.size());
|
||||
@ -1514,7 +1505,7 @@ IN_PROC_BROWSER_TEST_P(InputMethodEngineBrowserTest, MojoInteractionTest) {
|
||||
ASSERT_TRUE(
|
||||
content::ExecuteScript(host->host_contents(), commit_text_test_script));
|
||||
tic.WaitUntilCalled();
|
||||
EXPECT_EQ(base::UTF8ToUTF16("COMMIT_TEXT"), tic.inserted_text());
|
||||
EXPECT_EQ(u"COMMIT_TEXT", tic.inserted_text());
|
||||
}
|
||||
|
||||
{
|
||||
|
@ -361,9 +361,8 @@ IN_PROC_BROWSER_TEST_F(NativeInputMethodEngineTest, SuggestUserEmail) {
|
||||
TextInputTestHelper helper(GetBrowserInputMethod());
|
||||
SetUpTextInput(helper);
|
||||
|
||||
const std::u16string prefix_text = base::UTF8ToUTF16("my email is ");
|
||||
const std::u16string expected_result_text =
|
||||
base::UTF8ToUTF16("my email is johnwayne@me.xyz");
|
||||
const std::u16string prefix_text = u"my email is ";
|
||||
const std::u16string expected_result_text = u"my email is johnwayne@me.xyz";
|
||||
|
||||
helper.GetTextInputClient()->InsertText(
|
||||
prefix_text,
|
||||
@ -404,9 +403,8 @@ IN_PROC_BROWSER_TEST_F(NativeInputMethodEngineTest,
|
||||
TextInputTestHelper helper(GetBrowserInputMethod());
|
||||
SetUpTextInput(helper);
|
||||
|
||||
const std::u16string prefix_text = base::UTF8ToUTF16("my email is ");
|
||||
const std::u16string expected_result_text =
|
||||
base::UTF8ToUTF16("my email is john@abc.com");
|
||||
const std::u16string prefix_text = u"my email is ";
|
||||
const std::u16string expected_result_text = u"my email is john@abc.com";
|
||||
|
||||
helper.GetTextInputClient()->InsertText(
|
||||
prefix_text,
|
||||
@ -420,7 +418,7 @@ IN_PROC_BROWSER_TEST_F(NativeInputMethodEngineTest,
|
||||
DispatchKeyPress(ui::VKEY_DOWN, false);
|
||||
DispatchKeyPress(ui::VKEY_RETURN, false);
|
||||
helper.GetTextInputClient()->InsertText(
|
||||
base::UTF8ToUTF16("john@abc.com"),
|
||||
u"john@abc.com",
|
||||
ui::TextInputClient::InsertTextCursorBehavior::kMoveCursorAfterText);
|
||||
helper.WaitForSurroundingTextChanged(expected_result_text);
|
||||
|
||||
@ -440,7 +438,7 @@ IN_PROC_BROWSER_TEST_F(NativeInputMethodEngineTest, SuggestUserName) {
|
||||
autofill::AutofillProfile autofill_profile(base::GenerateGUID(),
|
||||
autofill::test::kEmptyOrigin);
|
||||
autofill_profile.SetRawInfo(autofill::ServerFieldType::NAME_FULL,
|
||||
base::UTF8ToUTF16("John Wayne"));
|
||||
u"John Wayne");
|
||||
autofill::PersonalDataManagerFactory::GetForProfile(profile_)->AddProfile(
|
||||
autofill_profile);
|
||||
personal_data_observer.Wait();
|
||||
@ -450,9 +448,8 @@ IN_PROC_BROWSER_TEST_F(NativeInputMethodEngineTest, SuggestUserName) {
|
||||
TextInputTestHelper helper(GetBrowserInputMethod());
|
||||
SetUpTextInput(helper);
|
||||
|
||||
const std::u16string prefix_text = base::UTF8ToUTF16("my name is ");
|
||||
const std::u16string expected_result_text =
|
||||
base::UTF8ToUTF16("my name is John Wayne");
|
||||
const std::u16string prefix_text = u"my name is ";
|
||||
const std::u16string expected_result_text = u"my name is John Wayne";
|
||||
|
||||
helper.GetTextInputClient()->InsertText(
|
||||
prefix_text,
|
||||
@ -467,9 +464,9 @@ IN_PROC_BROWSER_TEST_F(NativeInputMethodEngineTest, SuggestUserName) {
|
||||
|
||||
// Keep typing
|
||||
helper.GetTextInputClient()->InsertText(
|
||||
base::UTF8ToUTF16("jo"),
|
||||
u"jo",
|
||||
ui::TextInputClient::InsertTextCursorBehavior::kMoveCursorAfterText);
|
||||
helper.WaitForSurroundingTextChanged(base::UTF8ToUTF16("my name is jo"));
|
||||
helper.WaitForSurroundingTextChanged(u"my name is jo");
|
||||
|
||||
DispatchKeyPress(ui::VKEY_DOWN, false);
|
||||
DispatchKeyPress(ui::VKEY_RETURN, false);
|
||||
@ -526,8 +523,8 @@ IN_PROC_BROWSER_TEST_F(NativeInputMethodEngineTest, SuggestEmoji) {
|
||||
engine_->Enable(kEngineIdUs);
|
||||
TextInputTestHelper helper(GetBrowserInputMethod());
|
||||
SetUpTextInput(helper);
|
||||
const std::u16string prefix_text = base::UTF8ToUTF16("happy ");
|
||||
const std::u16string expected_result_text = base::UTF8ToUTF16("happy 😀");
|
||||
const std::u16string prefix_text = u"happy ";
|
||||
const std::u16string expected_result_text = u"happy 😀";
|
||||
|
||||
helper.GetTextInputClient()->InsertText(
|
||||
prefix_text,
|
||||
@ -559,8 +556,8 @@ IN_PROC_BROWSER_TEST_F(NativeInputMethodEngineTest,
|
||||
engine_->Enable(kEngineIdUs);
|
||||
TextInputTestHelper helper(GetBrowserInputMethod());
|
||||
SetUpTextInput(helper);
|
||||
const std::u16string prefix_text = base::UTF8ToUTF16("happy ");
|
||||
const std::u16string expected_result_text = base::UTF8ToUTF16("happy a");
|
||||
const std::u16string prefix_text = u"happy ";
|
||||
const std::u16string expected_result_text = u"happy a";
|
||||
|
||||
helper.GetTextInputClient()->InsertText(
|
||||
prefix_text,
|
||||
@ -568,7 +565,7 @@ IN_PROC_BROWSER_TEST_F(NativeInputMethodEngineTest,
|
||||
helper.WaitForSurroundingTextChanged(prefix_text);
|
||||
// Types something random to dismiss emoji
|
||||
helper.GetTextInputClient()->InsertText(
|
||||
base::UTF8ToUTF16("a"),
|
||||
u"a",
|
||||
ui::TextInputClient::InsertTextCursorBehavior::kMoveCursorAfterText);
|
||||
helper.WaitForSurroundingTextChanged(expected_result_text);
|
||||
|
||||
@ -711,7 +708,7 @@ IN_PROC_BROWSER_TEST_F(NativeInputMethodEngineTest,
|
||||
engine_->Enable(kEngineIdUs);
|
||||
TextInputTestHelper helper(GetBrowserInputMethod());
|
||||
SetUpTextInput(helper);
|
||||
const std::u16string prefix_text = base::UTF8ToUTF16("corrected ");
|
||||
const std::u16string prefix_text = u"corrected ";
|
||||
helper.GetTextInputClient()->InsertText(
|
||||
prefix_text,
|
||||
ui::TextInputClient::InsertTextCursorBehavior::kMoveCursorAfterText);
|
||||
@ -728,7 +725,7 @@ IN_PROC_BROWSER_TEST_F(NativeInputMethodEngineTest,
|
||||
|
||||
// Move cursor back into the autocorrected word to show the window.
|
||||
helper.GetTextInputClient()->ExtendSelectionAndDelete(1, 0);
|
||||
helper.WaitForSurroundingTextChanged(base::UTF8ToUTF16("corrected"));
|
||||
helper.WaitForSurroundingTextChanged(u"corrected");
|
||||
|
||||
EXPECT_TRUE(controller->GetUndoWindowForTesting());
|
||||
EXPECT_TRUE(controller->GetUndoWindowForTesting()->GetVisible());
|
||||
@ -740,9 +737,8 @@ IN_PROC_BROWSER_TEST_F(NativeInputMethodEngineTest, RevertsAutocorrect) {
|
||||
engine_->Enable(kEngineIdUs);
|
||||
TextInputTestHelper helper(GetBrowserInputMethod());
|
||||
SetUpTextInput(helper);
|
||||
const std::u16string corrected_text =
|
||||
base::UTF8ToUTF16("hello corrected world");
|
||||
const std::u16string typed_text = base::UTF8ToUTF16("hello typed world");
|
||||
const std::u16string corrected_text = u"hello corrected world";
|
||||
const std::u16string typed_text = u"hello typed world";
|
||||
helper.GetTextInputClient()->InsertText(
|
||||
corrected_text,
|
||||
ui::TextInputClient::InsertTextCursorBehavior::kMoveCursorAfterText);
|
||||
@ -782,8 +778,8 @@ IN_PROC_BROWSER_TEST_F(NativeInputMethodEngineTest,
|
||||
|
||||
TextInputTestHelper helper(GetBrowserInputMethod());
|
||||
SetUpTextInput(helper);
|
||||
const std::u16string corrected_text = base::UTF8ToUTF16("corrected");
|
||||
const std::u16string typed_text = base::UTF8ToUTF16("typed");
|
||||
const std::u16string corrected_text = u"corrected";
|
||||
const std::u16string typed_text = u"typed";
|
||||
helper.GetTextInputClient()->InsertText(
|
||||
corrected_text,
|
||||
ui::TextInputClient::InsertTextCursorBehavior::kMoveCursorAfterText);
|
||||
@ -823,8 +819,8 @@ IN_PROC_BROWSER_TEST_F(NativeInputMethodEngineTest,
|
||||
|
||||
TextInputTestHelper helper(GetBrowserInputMethod());
|
||||
SetUpTextInput(helper);
|
||||
const std::u16string corrected_text = base::UTF8ToUTF16("corrected");
|
||||
const std::u16string typed_text = base::UTF8ToUTF16("typed");
|
||||
const std::u16string corrected_text = u"corrected";
|
||||
const std::u16string typed_text = u"typed";
|
||||
helper.GetTextInputClient()->InsertText(
|
||||
corrected_text,
|
||||
ui::TextInputClient::InsertTextCursorBehavior::kMoveCursorAfterText);
|
||||
|
@ -179,13 +179,12 @@ class PersonalInfoSuggesterTest : public testing::Test {
|
||||
autofill::TestAutofillClient autofill_client_;
|
||||
std::unique_ptr<autofill::TestPersonalDataManager> personal_data_;
|
||||
|
||||
const std::u16string email_ = base::UTF8ToUTF16("johnwayne@me.xyz");
|
||||
const std::u16string first_name_ = base::UTF8ToUTF16("John");
|
||||
const std::u16string last_name_ = base::UTF8ToUTF16("Wayne");
|
||||
const std::u16string full_name_ = base::UTF8ToUTF16("John Wayne");
|
||||
const std::u16string address_ =
|
||||
base::UTF8ToUTF16("1 Dream Road, Hollywood, CA 12345");
|
||||
const std::u16string phone_number_ = base::UTF8ToUTF16("16505678910");
|
||||
const std::u16string email_ = u"johnwayne@me.xyz";
|
||||
const std::u16string first_name_ = u"John";
|
||||
const std::u16string last_name_ = u"Wayne";
|
||||
const std::u16string full_name_ = u"John Wayne";
|
||||
const std::u16string address_ = u"1 Dream Road, Hollywood, CA 12345";
|
||||
const std::u16string phone_number_ = u"16505678910";
|
||||
};
|
||||
|
||||
TEST_F(PersonalInfoSuggesterTest, SuggestEmail) {
|
||||
@ -196,15 +195,15 @@ TEST_F(PersonalInfoSuggesterTest, SuggestEmail) {
|
||||
|
||||
profile_->set_profile_name(base::UTF16ToUTF8(email_));
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my email is "));
|
||||
suggester_->Suggest(u"my email is ");
|
||||
suggestion_handler_->VerifySuggestion(email_, 0);
|
||||
SendKeyboardEvent(ui::DomCode::ESCAPE);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("My email is: "));
|
||||
suggester_->Suggest(u"My email is: ");
|
||||
suggestion_handler_->VerifySuggestion(email_, 0);
|
||||
SendKeyboardEvent(ui::DomCode::ESCAPE);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("hi, my email: "));
|
||||
suggester_->Suggest(u"hi, my email: ");
|
||||
suggestion_handler_->VerifySuggestion(email_, 0);
|
||||
}
|
||||
|
||||
@ -216,7 +215,7 @@ TEST_F(PersonalInfoSuggesterTest, DoNotSuggestEmailWhenFlagIsDisabled) {
|
||||
|
||||
profile_->set_profile_name(base::UTF16ToUTF8(email_));
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my email is "));
|
||||
suggester_->Suggest(u"my email is ");
|
||||
suggestion_handler_->VerifySuggestion(base::EmptyString16(), 0);
|
||||
}
|
||||
|
||||
@ -228,10 +227,10 @@ TEST_F(PersonalInfoSuggesterTest, DoNotSuggestEmailWhenPrefixDoesNotMatch) {
|
||||
|
||||
profile_->set_profile_name(base::UTF16ToUTF8(email_));
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my email is John"));
|
||||
suggester_->Suggest(u"my email is John");
|
||||
suggestion_handler_->VerifySuggestion(base::EmptyString16(), 0);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("our email is: "));
|
||||
suggester_->Suggest(u"our email is: ");
|
||||
suggestion_handler_->VerifySuggestion(base::EmptyString16(), 0);
|
||||
}
|
||||
|
||||
@ -244,7 +243,7 @@ TEST_F(PersonalInfoSuggesterTest, DoNotSuggestWhenVirtualKeyboardEnabled) {
|
||||
chrome_keyboard_controller_client_->set_keyboard_visible_for_test(true);
|
||||
profile_->set_profile_name(base::UTF16ToUTF8(email_));
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my email is "));
|
||||
suggester_->Suggest(u"my email is ");
|
||||
suggestion_handler_->VerifySuggestion(base::EmptyString16(), 0);
|
||||
}
|
||||
|
||||
@ -258,7 +257,7 @@ TEST_F(PersonalInfoSuggesterTest,
|
||||
chrome_keyboard_controller_client_->set_keyboard_visible_for_test(true);
|
||||
profile_->set_profile_name(base::UTF16ToUTF8(email_));
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my email is "));
|
||||
suggester_->Suggest(u"my email is ");
|
||||
suggestion_handler_->VerifySuggestionDispatchedToExtension(
|
||||
std::vector<std::string>{base::UTF16ToUTF8(email_)});
|
||||
}
|
||||
@ -277,19 +276,19 @@ TEST_F(PersonalInfoSuggesterTest, SuggestNames) {
|
||||
autofill_profile.SetRawInfo(autofill::ServerFieldType::NAME_FULL, full_name_);
|
||||
personal_data_->AddProfile(autofill_profile);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my first name is "));
|
||||
suggester_->Suggest(u"my first name is ");
|
||||
suggestion_handler_->VerifySuggestion(first_name_, 0);
|
||||
SendKeyboardEvent(ui::DomCode::ESCAPE);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my last name is: "));
|
||||
suggester_->Suggest(u"my last name is: ");
|
||||
suggestion_handler_->VerifySuggestion(last_name_, 0);
|
||||
SendKeyboardEvent(ui::DomCode::ESCAPE);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my name is "));
|
||||
suggester_->Suggest(u"my name is ");
|
||||
suggestion_handler_->VerifySuggestion(full_name_, 0);
|
||||
SendKeyboardEvent(ui::DomCode::ESCAPE);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("Hmm... my FULL name: "));
|
||||
suggester_->Suggest(u"Hmm... my FULL name: ");
|
||||
suggestion_handler_->VerifySuggestion(full_name_, 0);
|
||||
}
|
||||
|
||||
@ -307,7 +306,7 @@ TEST_F(PersonalInfoSuggesterTest, SuggestNamesButInsufficientData) {
|
||||
chromeos::AssistiveType::kPersonalName,
|
||||
0);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my name is "));
|
||||
suggester_->Suggest(u"my name is ");
|
||||
histogram_tester.ExpectUniqueSample("InputMethod.Assistive.InsufficientData",
|
||||
chromeos::AssistiveType::kPersonalName,
|
||||
1);
|
||||
@ -327,13 +326,13 @@ TEST_F(PersonalInfoSuggesterTest, DoNotSuggestNamesWhenFlagIsDisabled) {
|
||||
autofill_profile.SetRawInfo(autofill::ServerFieldType::NAME_FULL, full_name_);
|
||||
personal_data_->AddProfile(autofill_profile);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my first name is "));
|
||||
suggester_->Suggest(u"my first name is ");
|
||||
suggestion_handler_->VerifySuggestion(base::EmptyString16(), 0);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my last name is: "));
|
||||
suggester_->Suggest(u"my last name is: ");
|
||||
suggestion_handler_->VerifySuggestion(base::EmptyString16(), 0);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my name is "));
|
||||
suggester_->Suggest(u"my name is ");
|
||||
suggestion_handler_->VerifySuggestion(base::EmptyString16(), 0);
|
||||
}
|
||||
|
||||
@ -351,16 +350,16 @@ TEST_F(PersonalInfoSuggesterTest, DoNotSuggestNamesWhenPrefixDoesNotMatch) {
|
||||
autofill_profile.SetRawInfo(autofill::ServerFieldType::NAME_FULL, full_name_);
|
||||
personal_data_->AddProfile(autofill_profile);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("our first name is "));
|
||||
suggester_->Suggest(u"our first name is ");
|
||||
suggestion_handler_->VerifySuggestion(base::EmptyString16(), 0);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("our last name is: "));
|
||||
suggester_->Suggest(u"our last name is: ");
|
||||
suggestion_handler_->VerifySuggestion(base::EmptyString16(), 0);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("our name is "));
|
||||
suggester_->Suggest(u"our name is ");
|
||||
suggestion_handler_->VerifySuggestion(base::EmptyString16(), 0);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("our full name: "));
|
||||
suggester_->Suggest(u"our full name: ");
|
||||
suggestion_handler_->VerifySuggestion(base::EmptyString16(), 0);
|
||||
}
|
||||
|
||||
@ -374,34 +373,34 @@ TEST_F(PersonalInfoSuggesterTest, SuggestAddress) {
|
||||
autofill::AutofillProfile autofill_profile(base::GenerateGUID(),
|
||||
autofill::test::kEmptyOrigin);
|
||||
autofill_profile.SetRawInfo(autofill::ServerFieldType::ADDRESS_HOME_LINE1,
|
||||
base::UTF8ToUTF16("1 Dream Road"));
|
||||
u"1 Dream Road");
|
||||
autofill_profile.SetRawInfo(autofill::ServerFieldType::ADDRESS_HOME_CITY,
|
||||
base::UTF8ToUTF16("Hollywood"));
|
||||
u"Hollywood");
|
||||
autofill_profile.SetRawInfo(autofill::ServerFieldType::ADDRESS_HOME_ZIP,
|
||||
base::UTF8ToUTF16("12345"));
|
||||
u"12345");
|
||||
autofill_profile.SetRawInfo(autofill::ServerFieldType::ADDRESS_HOME_STATE,
|
||||
base::UTF8ToUTF16("CA"));
|
||||
u"CA");
|
||||
autofill_profile.SetRawInfo(autofill::ServerFieldType::ADDRESS_HOME_COUNTRY,
|
||||
base::UTF8ToUTF16("US"));
|
||||
u"US");
|
||||
personal_data_->AddProfile(autofill_profile);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my address is "));
|
||||
suggester_->Suggest(u"my address is ");
|
||||
suggestion_handler_->VerifySuggestion(address_, 0);
|
||||
SendKeyboardEvent(ui::DomCode::ESCAPE);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("our address is: "));
|
||||
suggester_->Suggest(u"our address is: ");
|
||||
suggestion_handler_->VerifySuggestion(address_, 0);
|
||||
SendKeyboardEvent(ui::DomCode::ESCAPE);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my shipping address: "));
|
||||
suggester_->Suggest(u"my shipping address: ");
|
||||
suggestion_handler_->VerifySuggestion(address_, 0);
|
||||
SendKeyboardEvent(ui::DomCode::ESCAPE);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("our billing address is "));
|
||||
suggester_->Suggest(u"our billing address is ");
|
||||
suggestion_handler_->VerifySuggestion(address_, 0);
|
||||
SendKeyboardEvent(ui::DomCode::ESCAPE);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my current address: "));
|
||||
suggester_->Suggest(u"my current address: ");
|
||||
suggestion_handler_->VerifySuggestion(address_, 0);
|
||||
}
|
||||
|
||||
@ -415,18 +414,18 @@ TEST_F(PersonalInfoSuggesterTest, DoNotSuggestAddressWhenFlagIsDisabled) {
|
||||
autofill::AutofillProfile autofill_profile(base::GenerateGUID(),
|
||||
autofill::test::kEmptyOrigin);
|
||||
autofill_profile.SetRawInfo(autofill::ServerFieldType::ADDRESS_HOME_LINE1,
|
||||
base::UTF8ToUTF16("1 Dream Road"));
|
||||
u"1 Dream Road");
|
||||
autofill_profile.SetRawInfo(autofill::ServerFieldType::ADDRESS_HOME_CITY,
|
||||
base::UTF8ToUTF16("Hollywood"));
|
||||
u"Hollywood");
|
||||
autofill_profile.SetRawInfo(autofill::ServerFieldType::ADDRESS_HOME_ZIP,
|
||||
base::UTF8ToUTF16("12345"));
|
||||
u"12345");
|
||||
autofill_profile.SetRawInfo(autofill::ServerFieldType::ADDRESS_HOME_STATE,
|
||||
base::UTF8ToUTF16("CA"));
|
||||
u"CA");
|
||||
autofill_profile.SetRawInfo(autofill::ServerFieldType::ADDRESS_HOME_COUNTRY,
|
||||
base::UTF8ToUTF16("US"));
|
||||
u"US");
|
||||
personal_data_->AddProfile(autofill_profile);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my address is "));
|
||||
suggester_->Suggest(u"my address is ");
|
||||
suggestion_handler_->VerifySuggestion(base::EmptyString16(), 0);
|
||||
}
|
||||
|
||||
@ -440,24 +439,24 @@ TEST_F(PersonalInfoSuggesterTest, DoNotSuggestAddressWhenPrefixDoesNotMatch) {
|
||||
autofill::AutofillProfile autofill_profile(base::GenerateGUID(),
|
||||
autofill::test::kEmptyOrigin);
|
||||
autofill_profile.SetRawInfo(autofill::ServerFieldType::ADDRESS_HOME_LINE1,
|
||||
base::UTF8ToUTF16("1 Dream Road"));
|
||||
u"1 Dream Road");
|
||||
autofill_profile.SetRawInfo(autofill::ServerFieldType::ADDRESS_HOME_CITY,
|
||||
base::UTF8ToUTF16("Hollywood"));
|
||||
u"Hollywood");
|
||||
autofill_profile.SetRawInfo(autofill::ServerFieldType::ADDRESS_HOME_ZIP,
|
||||
base::UTF8ToUTF16("12345"));
|
||||
u"12345");
|
||||
autofill_profile.SetRawInfo(autofill::ServerFieldType::ADDRESS_HOME_STATE,
|
||||
base::UTF8ToUTF16("CA"));
|
||||
u"CA");
|
||||
autofill_profile.SetRawInfo(autofill::ServerFieldType::ADDRESS_HOME_COUNTRY,
|
||||
base::UTF8ToUTF16("US"));
|
||||
u"US");
|
||||
personal_data_->AddProfile(autofill_profile);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my address "));
|
||||
suggester_->Suggest(u"my address ");
|
||||
suggestion_handler_->VerifySuggestion(base::EmptyString16(), 0);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my last address is: "));
|
||||
suggester_->Suggest(u"my last address is: ");
|
||||
suggestion_handler_->VerifySuggestion(base::EmptyString16(), 0);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("our address number is "));
|
||||
suggester_->Suggest(u"our address number is ");
|
||||
suggestion_handler_->VerifySuggestion(base::EmptyString16(), 0);
|
||||
}
|
||||
|
||||
@ -473,23 +472,23 @@ TEST_F(PersonalInfoSuggesterTest, SuggestPhoneNumber) {
|
||||
autofill::ServerFieldType::PHONE_HOME_WHOLE_NUMBER, phone_number_);
|
||||
personal_data_->AddProfile(autofill_profile);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my phone number is "));
|
||||
suggester_->Suggest(u"my phone number is ");
|
||||
suggestion_handler_->VerifySuggestion(phone_number_, 0);
|
||||
SendKeyboardEvent(ui::DomCode::ESCAPE);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my number is "));
|
||||
suggester_->Suggest(u"my number is ");
|
||||
suggestion_handler_->VerifySuggestion(phone_number_, 0);
|
||||
SendKeyboardEvent(ui::DomCode::ESCAPE);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my mobile number is: "));
|
||||
suggester_->Suggest(u"my mobile number is: ");
|
||||
suggestion_handler_->VerifySuggestion(phone_number_, 0);
|
||||
SendKeyboardEvent(ui::DomCode::ESCAPE);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my number: "));
|
||||
suggester_->Suggest(u"my number: ");
|
||||
suggestion_handler_->VerifySuggestion(phone_number_, 0);
|
||||
SendKeyboardEvent(ui::DomCode::ESCAPE);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my telephone number is "));
|
||||
suggester_->Suggest(u"my telephone number is ");
|
||||
suggestion_handler_->VerifySuggestion(phone_number_, 0);
|
||||
}
|
||||
|
||||
@ -506,7 +505,7 @@ TEST_F(PersonalInfoSuggesterTest, DoNotSuggestPhoneNumberWhenFlagIsDisabled) {
|
||||
autofill::ServerFieldType::PHONE_HOME_WHOLE_NUMBER, phone_number_);
|
||||
personal_data_->AddProfile(autofill_profile);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my phone number is "));
|
||||
suggester_->Suggest(u"my phone number is ");
|
||||
suggestion_handler_->VerifySuggestion(base::EmptyString16(), 0);
|
||||
}
|
||||
|
||||
@ -523,16 +522,16 @@ TEST_F(PersonalInfoSuggesterTest,
|
||||
autofill::ServerFieldType::PHONE_HOME_WHOLE_NUMBER, phone_number_);
|
||||
personal_data_->AddProfile(autofill_profile);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("our phone number is "));
|
||||
suggester_->Suggest(u"our phone number is ");
|
||||
suggestion_handler_->VerifySuggestion(base::EmptyString16(), 0);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my number "));
|
||||
suggester_->Suggest(u"my number ");
|
||||
suggestion_handler_->VerifySuggestion(base::EmptyString16(), 0);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my number phone is: "));
|
||||
suggester_->Suggest(u"my number phone is: ");
|
||||
suggestion_handler_->VerifySuggestion(base::EmptyString16(), 0);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my phone phone: "));
|
||||
suggester_->Suggest(u"my phone phone: ");
|
||||
suggestion_handler_->VerifySuggestion(base::EmptyString16(), 0);
|
||||
}
|
||||
|
||||
@ -544,7 +543,7 @@ TEST_F(PersonalInfoSuggesterTest, AcceptSuggestionWithDownEnter) {
|
||||
|
||||
profile_->set_profile_name(base::UTF16ToUTF8(email_));
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my email is "));
|
||||
suggester_->Suggest(u"my email is ");
|
||||
SendKeyboardEvent(ui::DomCode::ARROW_DOWN);
|
||||
SendKeyboardEvent(ui::DomCode::ENTER);
|
||||
|
||||
@ -563,7 +562,7 @@ TEST_F(PersonalInfoSuggesterTest, AcceptSuggestionWithUpEnter) {
|
||||
update->SetIntKey(kPersonalInfoSuggesterAcceptanceCount, 1);
|
||||
profile_->set_profile_name(base::UTF16ToUTF8(email_));
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my email is "));
|
||||
suggester_->Suggest(u"my email is ");
|
||||
SendKeyboardEvent(ui::DomCode::ARROW_UP);
|
||||
SendKeyboardEvent(ui::DomCode::ENTER);
|
||||
|
||||
@ -582,7 +581,7 @@ TEST_F(PersonalInfoSuggesterTest, DismissSuggestion) {
|
||||
autofill_profile.SetRawInfo(autofill::ServerFieldType::NAME_FULL, full_name_);
|
||||
personal_data_->AddProfile(autofill_profile);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my name is "));
|
||||
suggester_->Suggest(u"my name is ");
|
||||
SendKeyboardEvent(ui::DomCode::ESCAPE);
|
||||
suggestion_handler_->VerifySuggestion(base::EmptyString16(), 0);
|
||||
EXPECT_FALSE(suggestion_handler_->IsSuggestionAccepted());
|
||||
@ -600,8 +599,8 @@ TEST_F(PersonalInfoSuggesterTest, SuggestWithConfirmedLength) {
|
||||
autofill::ServerFieldType::PHONE_HOME_WHOLE_NUMBER, phone_number_);
|
||||
personal_data_->AddProfile(autofill_profile);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my phone number is "));
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my phone number is 16"));
|
||||
suggester_->Suggest(u"my phone number is ");
|
||||
suggester_->Suggest(u"my phone number is 16");
|
||||
suggestion_handler_->VerifySuggestion(phone_number_, 2);
|
||||
}
|
||||
|
||||
@ -616,7 +615,7 @@ TEST_F(PersonalInfoSuggesterTest,
|
||||
profile_->GetPrefs()->SetBoolean(
|
||||
ash::prefs::kAccessibilitySpokenFeedbackEnabled, false);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my email is "));
|
||||
suggester_->Suggest(u"my email is ");
|
||||
task_environment_.FastForwardBy(base::TimeDelta::FromMilliseconds(5000));
|
||||
tts_handler_->VerifyAnnouncement("");
|
||||
|
||||
@ -636,7 +635,7 @@ TEST_F(PersonalInfoSuggesterTest, AnnounceSpokenFeedbackWhenChromeVoxIsOn) {
|
||||
profile_->GetPrefs()->SetBoolean(
|
||||
ash::prefs::kAccessibilitySpokenFeedbackEnabled, true);
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my email is "));
|
||||
suggester_->Suggest(u"my email is ");
|
||||
task_environment_.FastForwardBy(base::TimeDelta::FromMilliseconds(500));
|
||||
tts_handler_->VerifyAnnouncement("");
|
||||
|
||||
@ -649,7 +648,7 @@ TEST_F(PersonalInfoSuggesterTest, AnnounceSpokenFeedbackWhenChromeVoxIsOn) {
|
||||
task_environment_.FastForwardBy(base::TimeDelta::FromMilliseconds(200));
|
||||
tts_handler_->VerifyAnnouncement("Suggestion inserted.");
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my email is "));
|
||||
suggester_->Suggest(u"my email is ");
|
||||
task_environment_.FastForwardBy(base::TimeDelta::FromMilliseconds(1500));
|
||||
tts_handler_->VerifyAnnouncement(
|
||||
"Personal info suggested. Press down arrow to access; escape to ignore.");
|
||||
@ -665,12 +664,12 @@ TEST_F(PersonalInfoSuggesterTest, DoNotShowAnnotationAfterMaxAcceptanceCount) {
|
||||
/*disabled_features=*/{});
|
||||
|
||||
for (int i = 0; i < kMaxAcceptanceCount; i++) {
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my email is "));
|
||||
suggester_->Suggest(u"my email is ");
|
||||
SendKeyboardEvent(ui::DomCode::ARROW_DOWN);
|
||||
SendKeyboardEvent(ui::DomCode::ENTER);
|
||||
suggestion_handler_->VerifyShowAnnotation(true);
|
||||
}
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my email is "));
|
||||
suggester_->Suggest(u"my email is ");
|
||||
suggestion_handler_->VerifyShowAnnotation(false);
|
||||
}
|
||||
|
||||
@ -685,12 +684,12 @@ TEST_F(PersonalInfoSuggesterTest, ShowSettingLink) {
|
||||
update->RemoveKey(kPersonalInfoSuggesterShowSettingCount);
|
||||
update->RemoveKey(kPersonalInfoSuggesterAcceptanceCount);
|
||||
for (int i = 0; i < kMaxShowSettingCount; i++) {
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my email is "));
|
||||
suggester_->Suggest(u"my email is ");
|
||||
// Dismiss suggestion.
|
||||
SendKeyboardEvent(ui::DomCode::ESCAPE);
|
||||
suggestion_handler_->VerifyShowSettingLink(true);
|
||||
}
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my email is "));
|
||||
suggester_->Suggest(u"my email is ");
|
||||
suggestion_handler_->VerifyShowSettingLink(false);
|
||||
}
|
||||
|
||||
@ -703,12 +702,12 @@ TEST_F(PersonalInfoSuggesterTest, DoNotShowSettingLinkAfterAcceptance) {
|
||||
DictionaryPrefUpdate update(profile_->GetPrefs(),
|
||||
prefs::kAssistiveInputFeatureSettings);
|
||||
update->SetIntKey(kPersonalInfoSuggesterShowSettingCount, 0);
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my email is "));
|
||||
suggester_->Suggest(u"my email is ");
|
||||
suggestion_handler_->VerifyShowSettingLink(true);
|
||||
// Accept suggestion.
|
||||
SendKeyboardEvent(ui::DomCode::ARROW_DOWN);
|
||||
SendKeyboardEvent(ui::DomCode::ENTER);
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my email is "));
|
||||
suggester_->Suggest(u"my email is ");
|
||||
suggestion_handler_->VerifyShowSettingLink(false);
|
||||
}
|
||||
|
||||
@ -724,7 +723,7 @@ TEST_F(PersonalInfoSuggesterTest, ClickSettingsWithDownDownEnter) {
|
||||
update->RemoveKey(kPersonalInfoSuggesterAcceptanceCount);
|
||||
profile_->set_profile_name(base::UTF16ToUTF8(email_));
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my email is "));
|
||||
suggester_->Suggest(u"my email is ");
|
||||
SendKeyboardEvent(ui::DomCode::ARROW_DOWN);
|
||||
SendKeyboardEvent(ui::DomCode::ARROW_DOWN);
|
||||
SendKeyboardEvent(ui::DomCode::ENTER);
|
||||
@ -745,7 +744,7 @@ TEST_F(PersonalInfoSuggesterTest, ClickSettingsWithUpEnter) {
|
||||
update->RemoveKey(kPersonalInfoSuggesterAcceptanceCount);
|
||||
profile_->set_profile_name(base::UTF16ToUTF8(email_));
|
||||
|
||||
suggester_->Suggest(base::UTF8ToUTF16("my email is "));
|
||||
suggester_->Suggest(u"my email is ");
|
||||
SendKeyboardEvent(ui::DomCode::ARROW_UP);
|
||||
SendKeyboardEvent(ui::DomCode::ENTER);
|
||||
|
||||
@ -765,7 +764,7 @@ TEST_F(PersonalInfoSuggesterTest, RecordsTimeToAccept) {
|
||||
|
||||
profile_->set_profile_name(base::UTF16ToUTF8(email_));
|
||||
|
||||
EXPECT_TRUE(suggester_->Suggest(base::UTF8ToUTF16("my email is ")));
|
||||
EXPECT_TRUE(suggester_->Suggest(u"my email is "));
|
||||
|
||||
// Press ui::DomCode::ARROW_DOWN to choose and accept the suggestion.
|
||||
SendKeyboardEvent(ui::DomCode::ARROW_DOWN);
|
||||
@ -786,7 +785,7 @@ TEST_F(PersonalInfoSuggesterTest, RecordsTimeToDismiss) {
|
||||
|
||||
profile_->set_profile_name(base::UTF16ToUTF8(email_));
|
||||
|
||||
EXPECT_TRUE(suggester_->Suggest(base::UTF8ToUTF16("my email is ")));
|
||||
EXPECT_TRUE(suggester_->Suggest(u"my email is "));
|
||||
// Press ui::DomCode::ESCAPE to dismiss.
|
||||
SendKeyboardEvent(ui::DomCode::ESCAPE);
|
||||
histogram_tester.ExpectTotalCount(
|
||||
|
@ -35,8 +35,8 @@ IN_PROC_BROWSER_TEST_F(TextInput_SurroundingTextChangedTest,
|
||||
helper.WaitForTextInputStateChanged(ui::TEXT_INPUT_TYPE_TEXT_AREA);
|
||||
EXPECT_EQ(ui::TEXT_INPUT_TYPE_TEXT_AREA, helper.GetTextInputType());
|
||||
|
||||
const std::u16string sample_text1 = base::UTF8ToUTF16("abcde");
|
||||
const std::u16string sample_text2 = base::UTF8ToUTF16("fghij");
|
||||
const std::u16string sample_text1 = u"abcde";
|
||||
const std::u16string sample_text2 = u"fghij";
|
||||
const std::u16string surrounding_text2 = sample_text1 + sample_text2;
|
||||
gfx::Range expected_range1(5, 5);
|
||||
gfx::Range expected_range2(10, 10);
|
||||
@ -76,7 +76,7 @@ IN_PROC_BROWSER_TEST_F(TextInput_SurroundingTextChangedTest,
|
||||
helper.WaitForTextInputStateChanged(ui::TEXT_INPUT_TYPE_TEXT_AREA);
|
||||
EXPECT_EQ(ui::TEXT_INPUT_TYPE_TEXT_AREA, helper.GetTextInputType());
|
||||
|
||||
const std::u16string sample_text = base::UTF8ToUTF16("abcde");
|
||||
const std::u16string sample_text = u"abcde";
|
||||
gfx::Range expected_range(5, 5);
|
||||
|
||||
ui::CompositionText composition_text;
|
||||
@ -122,7 +122,7 @@ IN_PROC_BROWSER_TEST_F(TextInput_SurroundingTextChangedTest,
|
||||
|
||||
// Click textarea containing text, so expecting new surrounding text comes.
|
||||
helper.ClickElement("filled_textarea", tab);
|
||||
const std::u16string expected_text = base::UTF8ToUTF16("abcde");
|
||||
const std::u16string expected_text = u"abcde";
|
||||
const gfx::Range expected_range(5, 5);
|
||||
helper.WaitForSurroundingTextChanged(expected_text, expected_range);
|
||||
EXPECT_EQ(expected_text, helper.GetSurroundingText());
|
||||
|
@ -289,20 +289,19 @@ TEST_F(CandidateWindowViewTest, DoNotChangeRowHeightWithLabelSwitchTest) {
|
||||
ui::CandidateWindow candidate_window;
|
||||
ui::CandidateWindow no_shortcut_candidate_window;
|
||||
|
||||
const std::u16string kSampleCandidate1 = base::UTF8ToUTF16("Sample String 1");
|
||||
const std::u16string kSampleCandidate1 = u"Sample String 1";
|
||||
const std::u16string kSampleCandidate2 =
|
||||
base::UTF8ToUTF16("\xE3\x81\x82"); // multi byte string.
|
||||
const std::u16string kSampleCandidate3 = base::UTF8ToUTF16(".....");
|
||||
const std::u16string kSampleCandidate3 = u".....";
|
||||
|
||||
const std::u16string kSampleShortcut1 = base::UTF8ToUTF16("1");
|
||||
const std::u16string kSampleShortcut2 = base::UTF8ToUTF16("b");
|
||||
const std::u16string kSampleShortcut3 = base::UTF8ToUTF16("C");
|
||||
const std::u16string kSampleShortcut1 = u"1";
|
||||
const std::u16string kSampleShortcut2 = u"b";
|
||||
const std::u16string kSampleShortcut3 = u"C";
|
||||
|
||||
const std::u16string kSampleAnnotation1 =
|
||||
base::UTF8ToUTF16("Sample Annotation 1");
|
||||
const std::u16string kSampleAnnotation1 = u"Sample Annotation 1";
|
||||
const std::u16string kSampleAnnotation2 =
|
||||
base::UTF8ToUTF16("\xE3\x81\x82"); // multi byte string.
|
||||
const std::u16string kSampleAnnotation3 = base::UTF8ToUTF16("......");
|
||||
const std::u16string kSampleAnnotation3 = u"......";
|
||||
|
||||
// Create CandidateWindow object.
|
||||
InitCandidateWindow(kPageSize, &candidate_window);
|
||||
|
@ -178,16 +178,16 @@ class BrowserTabsMetadataFetcherImplTest : public testing::Test {
|
||||
};
|
||||
|
||||
TEST_F(BrowserTabsMetadataFetcherImplTest, NewFetchDuringOldFetchInProgress) {
|
||||
const std::u16string kTitleA = base::UTF8ToUTF16("A");
|
||||
const std::u16string kTitleA = u"A";
|
||||
const GURL kUrlA = GURL("http://a.com");
|
||||
|
||||
const std::u16string kTitleB = base::UTF8ToUTF16("B");
|
||||
const std::u16string kTitleB = u"B";
|
||||
const GURL kUrlB = GURL("http://b.com");
|
||||
|
||||
const std::u16string kTitleC = base::UTF8ToUTF16("C");
|
||||
const std::u16string kTitleC = u"C";
|
||||
const GURL kUrlC = GURL("http://c.com");
|
||||
|
||||
const std::u16string kTitleD = base::UTF8ToUTF16("D");
|
||||
const std::u16string kTitleD = u"D";
|
||||
const GURL kUrlD = GURL("http://d.com");
|
||||
|
||||
auto synced_session_window =
|
||||
@ -243,10 +243,10 @@ TEST_F(BrowserTabsMetadataFetcherImplTest, NoTabsOpen) {
|
||||
}
|
||||
|
||||
TEST_F(BrowserTabsMetadataFetcherImplTest, BelowMaximumNumberOfTabs) {
|
||||
const std::u16string kTitleC = base::UTF8ToUTF16("C");
|
||||
const std::u16string kTitleC = u"C";
|
||||
const GURL kUrlC = GURL("http://c.com");
|
||||
|
||||
const std::u16string kTitleD = base::UTF8ToUTF16("D");
|
||||
const std::u16string kTitleD = u"D";
|
||||
const GURL kUrlD = GURL("http://d.com");
|
||||
|
||||
auto synced_session_window =
|
||||
@ -267,22 +267,22 @@ TEST_F(BrowserTabsMetadataFetcherImplTest, BelowMaximumNumberOfTabs) {
|
||||
}
|
||||
|
||||
TEST_F(BrowserTabsMetadataFetcherImplTest, ExceedMaximumNumberOfTabs) {
|
||||
const std::u16string kTitleA = base::UTF8ToUTF16("A");
|
||||
const std::u16string kTitleA = u"A";
|
||||
const GURL kUrlA = GURL("http://a.com");
|
||||
|
||||
const std::u16string kTitleB = base::UTF8ToUTF16("B");
|
||||
const std::u16string kTitleB = u"B";
|
||||
const GURL kUrlB = GURL("http://b.com");
|
||||
|
||||
const std::u16string kTitleC = base::UTF8ToUTF16("C");
|
||||
const std::u16string kTitleC = u"C";
|
||||
const GURL kUrlC = GURL("http://c.com");
|
||||
|
||||
const std::u16string kTitleD = base::UTF8ToUTF16("D");
|
||||
const std::u16string kTitleD = u"D";
|
||||
const GURL kUrlD = GURL("http://d.com");
|
||||
|
||||
const std::u16string kTitleE = base::UTF8ToUTF16("E");
|
||||
const std::u16string kTitleE = u"E";
|
||||
const GURL kUrlE = GURL(chrome::kChromeUINewTabURL);
|
||||
|
||||
const std::u16string kTitleF = base::UTF8ToUTF16("F");
|
||||
const std::u16string kTitleF = u"F";
|
||||
const GURL kUrlF = GURL("content://image.png");
|
||||
|
||||
auto synced_session_window =
|
||||
@ -311,16 +311,16 @@ TEST_F(BrowserTabsMetadataFetcherImplTest, ExceedMaximumNumberOfTabs) {
|
||||
}
|
||||
|
||||
TEST_F(BrowserTabsMetadataFetcherImplTest, MultipleWindows) {
|
||||
const std::u16string kTitleB = base::UTF8ToUTF16("B");
|
||||
const std::u16string kTitleB = u"B";
|
||||
const GURL kUrlB = GURL("http://b.com");
|
||||
|
||||
const std::u16string kTitleC = base::UTF8ToUTF16("C");
|
||||
const std::u16string kTitleC = u"C";
|
||||
const GURL kUrlC = GURL("http://c.com");
|
||||
|
||||
const std::u16string kTitleD = base::UTF8ToUTF16("D");
|
||||
const std::u16string kTitleD = u"D";
|
||||
const GURL kUrlD = GURL("http://d.com");
|
||||
|
||||
const std::u16string kTitleE = base::UTF8ToUTF16("E");
|
||||
const std::u16string kTitleE = u"E";
|
||||
const GURL kUrlE = GURL("http://e.com");
|
||||
|
||||
auto synced_session_window_one =
|
||||
|
@ -164,7 +164,7 @@ class DataTransferDlpBrowserTest : public LoginPolicyTestBase {
|
||||
params.type = views::Widget::InitParams::TYPE_WINDOW_FRAMELESS;
|
||||
widget_->Init(std::move(params));
|
||||
textfield_ = widget_->SetContentsView(std::make_unique<views::Textfield>());
|
||||
textfield_->SetAccessibleName(base::UTF8ToUTF16("Textfield"));
|
||||
textfield_->SetAccessibleName(u"Textfield");
|
||||
textfield_->SetFocusBehavior(views::View::FocusBehavior::ALWAYS);
|
||||
|
||||
// Show the widget.
|
||||
|
@ -296,8 +296,8 @@ IN_PROC_BROWSER_TEST_F(DlpContentManagerBrowserTest,
|
||||
browser()->window()->GetNativeWindow()->GetRootWindow();
|
||||
const auto media_id = content::DesktopMediaID::RegisterNativeWindow(
|
||||
content::DesktopMediaID::TYPE_SCREEN, root_window);
|
||||
manager->OnScreenCaptureStarted(
|
||||
"label", {media_id}, base::UTF8ToUTF16("example.com"), base::DoNothing());
|
||||
manager->OnScreenCaptureStarted("label", {media_id}, u"example.com",
|
||||
base::DoNothing());
|
||||
|
||||
EXPECT_FALSE(display_service_tester.GetNotification(
|
||||
kScreenCapturePausedNotificationId));
|
||||
|
@ -162,8 +162,8 @@ class UserCloudPolicyManagerChromeOSTest
|
||||
GetIdentityTestEnvironmentFactories();
|
||||
profile_ = profile_manager_->CreateTestingProfile(
|
||||
chrome::kInitialProfile,
|
||||
std::unique_ptr<sync_preferences::PrefServiceSyncable>(),
|
||||
base::UTF8ToUTF16(""), 0, std::string(), std::move(factories));
|
||||
std::unique_ptr<sync_preferences::PrefServiceSyncable>(), u"", 0,
|
||||
std::string(), std::move(factories));
|
||||
identity_test_env_profile_adaptor_ =
|
||||
std::make_unique<IdentityTestEnvironmentProfileAdaptor>(profile_);
|
||||
|
||||
|
@ -65,8 +65,8 @@ using EchoDialogViewTest = views::ViewsTestBase;
|
||||
TEST_F(EchoDialogViewTest, EnabledHasEnabledText) {
|
||||
EchoDialogView::Params params;
|
||||
params.echo_enabled = true;
|
||||
params.service_name = base::UTF8ToUTF16("$service");
|
||||
params.origin = base::UTF8ToUTF16("$origin");
|
||||
params.service_name = u"$service";
|
||||
params.origin = u"$origin";
|
||||
|
||||
TestEchoDialogListener listener;
|
||||
EchoDialogView dialog(&listener, params);
|
||||
@ -83,8 +83,8 @@ TEST_F(EchoDialogViewTest, EnabledHasEnabledText) {
|
||||
TEST_F(EchoDialogViewTest, DisabledHasDisabledText) {
|
||||
EchoDialogView::Params params;
|
||||
params.echo_enabled = false;
|
||||
params.service_name = base::UTF8ToUTF16("$service");
|
||||
params.origin = base::UTF8ToUTF16("$origin");
|
||||
params.service_name = u"$service";
|
||||
params.origin = u"$origin";
|
||||
|
||||
TestEchoDialogListener listener;
|
||||
EchoDialogView dialog(&listener, params);
|
||||
|
@ -1020,7 +1020,7 @@ IN_PROC_BROWSER_TEST_F(ContentSettingsTest, ContentSettingsBlockDataURLs) {
|
||||
|
||||
content::WebContents* web_contents =
|
||||
browser()->tab_strip_model()->GetActiveWebContents();
|
||||
ASSERT_EQ(base::UTF8ToUTF16("Data URL"), web_contents->GetTitle());
|
||||
ASSERT_EQ(u"Data URL", web_contents->GetTitle());
|
||||
|
||||
EXPECT_TRUE(
|
||||
PageSpecificContentSettings::GetForFrame(web_contents->GetMainFrame())
|
||||
|
@ -4543,8 +4543,8 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, CrossOriginDownloadNavigatesIframe) {
|
||||
|
||||
// Clicking the <a download> in the iframe should navigate the iframe,
|
||||
// not the main frame.
|
||||
std::u16string expected_title(base::UTF8ToUTF16("Loaded as iframe"));
|
||||
std::u16string failed_title(base::UTF8ToUTF16("Loaded as main frame"));
|
||||
std::u16string expected_title(u"Loaded as iframe");
|
||||
std::u16string failed_title(u"Loaded as main frame");
|
||||
content::TitleWatcher title_watcher(web_contents, expected_title);
|
||||
title_watcher.AlsoWaitForTitle(failed_title);
|
||||
render_frame_host->ExecuteJavaScriptForTests(base::ASCIIToUTF16("runTest();"),
|
||||
|
@ -152,7 +152,7 @@ AnalysisSettings* NormalDlpAndMalwareSettings() {
|
||||
AnalysisSettings* NormalSettingsWithCustomMessage() {
|
||||
static base::NoDestructor<AnalysisSettings> settings([]() {
|
||||
AnalysisSettings settings = NormalSettingsWithTags({"dlp", "malware"});
|
||||
settings.custom_message_text = base::UTF8ToUTF16("abcèéç");
|
||||
settings.custom_message_text = u"abcèéç";
|
||||
return settings;
|
||||
}());
|
||||
return settings.get();
|
||||
|
@ -1241,7 +1241,7 @@ TEST_F(ContentAnalysisDelegateAuditOnlyTest, NoDelay) {
|
||||
ASSERT_TRUE(
|
||||
ContentAnalysisDelegate::IsEnabled(profile(), url, &data, FILE_ATTACHED));
|
||||
|
||||
data.text.emplace_back(base::UTF8ToUTF16("dlp_text"));
|
||||
data.text.emplace_back(u"dlp_text");
|
||||
CreateFilesForTest({FILE_PATH_LITERAL("foo_fail_malware_0.doc"),
|
||||
FILE_PATH_LITERAL("foo_fail_malware_1.doc"),
|
||||
FILE_PATH_LITERAL("foo_fail_malware_2.doc"),
|
||||
|
@ -279,20 +279,15 @@ TEST_F(ExtensionInfoGeneratorUnitTest, BasicInfoTest) {
|
||||
ErrorConsole* error_console = ErrorConsole::Get(profile());
|
||||
const GURL kContextUrl("http://example.com");
|
||||
error_console->ReportError(std::make_unique<RuntimeError>(
|
||||
extension->id(), false, base::UTF8ToUTF16("source"),
|
||||
base::UTF8ToUTF16("message"),
|
||||
StackTrace(1, StackFrame(1, 1, base::UTF8ToUTF16("source"),
|
||||
base::UTF8ToUTF16("function"))),
|
||||
kContextUrl, logging::LOG_ERROR, 1, 1));
|
||||
extension->id(), false, u"source", u"message",
|
||||
StackTrace(1, StackFrame(1, 1, u"source", u"function")), kContextUrl,
|
||||
logging::LOG_ERROR, 1, 1));
|
||||
error_console->ReportError(std::make_unique<ManifestError>(
|
||||
extension->id(), base::UTF8ToUTF16("message"), base::UTF8ToUTF16("key"),
|
||||
std::u16string()));
|
||||
extension->id(), u"message", u"key", std::u16string()));
|
||||
error_console->ReportError(std::make_unique<RuntimeError>(
|
||||
extension->id(), false, base::UTF8ToUTF16("source"),
|
||||
base::UTF8ToUTF16("message"),
|
||||
StackTrace(1, StackFrame(1, 1, base::UTF8ToUTF16("source"),
|
||||
base::UTF8ToUTF16("function"))),
|
||||
kContextUrl, logging::LOG_WARNING, 1, 1));
|
||||
extension->id(), false, u"source", u"message",
|
||||
StackTrace(1, StackFrame(1, 1, u"source", u"function")), kContextUrl,
|
||||
logging::LOG_WARNING, 1, 1));
|
||||
|
||||
// It's not feasible to validate every field here, because that would be
|
||||
// a duplication of the logic in the method itself. Instead, test a handful
|
||||
|
@ -154,7 +154,7 @@ TEST(FileSystemApiUnitTest, FileSystemChooseEntryFunctionFileTypeInfoTest) {
|
||||
FileSystemChooseEntryFunction::BuildFileTypeInfo(&file_type_info,
|
||||
base::FilePath::StringType(), &options, &acceptsAllTypes);
|
||||
EXPECT_EQ(file_type_info.extension_description_overrides[0],
|
||||
base::UTF8ToUTF16("File Types 101"));
|
||||
u"File Types 101");
|
||||
}
|
||||
|
||||
TEST(FileSystemApiUnitTest, FileSystemChooseEntryFunctionSuggestionTest) {
|
||||
|
@ -230,7 +230,7 @@ class ManagementPolicyMock : public extensions::ManagementPolicy::Provider {
|
||||
bool UserMayLoad(const Extension* extension,
|
||||
std::u16string* error) const override {
|
||||
if (error)
|
||||
*error = base::UTF8ToUTF16("Dummy error message");
|
||||
*error = u"Dummy error message";
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
@ -667,15 +667,12 @@ IN_PROC_BROWSER_TEST_P(ExtensionContextMenuLazyTest, TopLevel) {
|
||||
ASSERT_TRUE(menu->GetMenuModelAndItemIndex(
|
||||
ContextMenuMatcher::ConvertToExtensionsCustomCommandId(0), &model,
|
||||
&index));
|
||||
EXPECT_EQ(base::UTF8ToUTF16("An Extension with multiple Context Menus"),
|
||||
EXPECT_EQ(u"An Extension with multiple Context Menus",
|
||||
model->GetLabelAt(index++));
|
||||
EXPECT_EQ(base::UTF8ToUTF16("Context Menu #1 - Extension #2"),
|
||||
model->GetLabelAt(index++));
|
||||
EXPECT_EQ(base::UTF8ToUTF16("Context Menu #2 - Extension #3"),
|
||||
model->GetLabelAt(index++));
|
||||
EXPECT_EQ(base::UTF8ToUTF16("Context Menu #3 - Extension #1"),
|
||||
model->GetLabelAt(index++));
|
||||
EXPECT_EQ(base::UTF8ToUTF16("Ze Extension with multiple Context Menus"),
|
||||
EXPECT_EQ(u"Context Menu #1 - Extension #2", model->GetLabelAt(index++));
|
||||
EXPECT_EQ(u"Context Menu #2 - Extension #3", model->GetLabelAt(index++));
|
||||
EXPECT_EQ(u"Context Menu #3 - Extension #1", model->GetLabelAt(index++));
|
||||
EXPECT_EQ(u"Ze Extension with multiple Context Menus",
|
||||
model->GetLabelAt(index++));
|
||||
}
|
||||
|
||||
@ -787,7 +784,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionContextMenuPersistentTest, Separators) {
|
||||
ContextMenuMatcher::ConvertToExtensionsCustomCommandId(0),
|
||||
&model,
|
||||
&index));
|
||||
EXPECT_EQ(base::UTF8ToUTF16("parent"), model->GetLabelAt(index));
|
||||
EXPECT_EQ(u"parent", model->GetLabelAt(index));
|
||||
submenu = model->GetSubmenuModelAt(index);
|
||||
ASSERT_TRUE(submenu);
|
||||
VerifyMenuForSeparatorsTest(*submenu);
|
||||
|
@ -56,13 +56,12 @@ TEST(ExtensionErrorUIDefaultTest, BubbleTitleAndMessageMentionsExtension) {
|
||||
|
||||
std::vector<std::u16string> messages = bubble->GetBubbleViewMessages();
|
||||
|
||||
EXPECT_THAT(
|
||||
messages,
|
||||
testing::ElementsAre(
|
||||
l10n_util::GetStringFUTF16(IDS_EXTENSION_ALERT_ITEM_BLOCKLISTED_OTHER,
|
||||
base::UTF8ToUTF16("Bar")),
|
||||
l10n_util::GetStringFUTF16(IDS_EXTENSION_ALERT_ITEM_BLOCKLISTED_OTHER,
|
||||
base::UTF8ToUTF16("Baz"))));
|
||||
EXPECT_THAT(messages,
|
||||
testing::ElementsAre(
|
||||
l10n_util::GetStringFUTF16(
|
||||
IDS_EXTENSION_ALERT_ITEM_BLOCKLISTED_OTHER, u"Bar"),
|
||||
l10n_util::GetStringFUTF16(
|
||||
IDS_EXTENSION_ALERT_ITEM_BLOCKLISTED_OTHER, u"Baz")));
|
||||
}
|
||||
|
||||
TEST(ExtensionErrorUIDefaultTest, BubbleTitleAndMessageMentionsApp) {
|
||||
@ -82,8 +81,7 @@ TEST(ExtensionErrorUIDefaultTest, BubbleTitleAndMessageMentionsApp) {
|
||||
std::vector<std::u16string> messages = bubble->GetBubbleViewMessages();
|
||||
|
||||
EXPECT_THAT(messages, testing::ElementsAre(l10n_util::GetStringFUTF16(
|
||||
IDS_APP_ALERT_ITEM_BLOCKLISTED_OTHER,
|
||||
base::UTF8ToUTF16("Bar"))));
|
||||
IDS_APP_ALERT_ITEM_BLOCKLISTED_OTHER, u"Bar")));
|
||||
}
|
||||
|
||||
TEST(ExtensionErrorUIDefaultTest, BubbleMessageMentionsMalware) {
|
||||
|
@ -5196,8 +5196,8 @@ namespace {
|
||||
void CreateDatabase(storage::DatabaseTracker* db_tracker,
|
||||
const std::string& origin_id) {
|
||||
DCHECK(db_tracker->task_runner()->RunsTasksInCurrentSequence());
|
||||
std::u16string db_name = base::UTF8ToUTF16("db");
|
||||
std::u16string description = base::UTF8ToUTF16("db_description");
|
||||
std::u16string db_name = u"db";
|
||||
std::u16string description = u"db_description";
|
||||
int64_t size;
|
||||
db_tracker->DatabaseOpened(origin_id, db_name, description, &size);
|
||||
db_tracker->DatabaseClosed(origin_id, db_name);
|
||||
|
@ -48,9 +48,8 @@ void ForceInstalledTestBase::SetUp() {
|
||||
TestingBrowserProcess::GetGlobal());
|
||||
ASSERT_TRUE(profile_manager_->SetUp());
|
||||
profile_ = profile_manager_->CreateTestingProfile(
|
||||
"p1", nullptr, base::UTF8ToUTF16("p1"), 0, "",
|
||||
TestingProfile::TestingFactories(), base::nullopt,
|
||||
std::move(policy_service));
|
||||
"p1", nullptr, u"p1", 0, "", TestingProfile::TestingFactories(),
|
||||
base::nullopt, std::move(policy_service));
|
||||
|
||||
prefs_ = profile_->GetTestingPrefService();
|
||||
registry_ = ExtensionRegistry::Get(profile_);
|
||||
|
@ -637,9 +637,8 @@ IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, EventDispatchToTab) {
|
||||
BookmarkModel* bookmark_model =
|
||||
BookmarkModelFactory::GetForBrowserContext(browser()->profile());
|
||||
bookmarks::test::WaitForBookmarkModelToLoad(bookmark_model);
|
||||
bookmarks::AddIfNotBookmarked(bookmark_model,
|
||||
GURL("http://www.google.com"),
|
||||
base::UTF8ToUTF16("Google"));
|
||||
bookmarks::AddIfNotBookmarked(bookmark_model, GURL("http://www.google.com"),
|
||||
u"Google");
|
||||
|
||||
EXPECT_TRUE(event_page_ready.WaitUntilSatisfied());
|
||||
|
||||
|
@ -166,7 +166,7 @@ void PluginManager::UpdatePluginListWithNaClModules() {
|
||||
content::WebPluginMimeType mime_type_info;
|
||||
mime_type_info.mime_type = iter->mime_type;
|
||||
mime_type_info.additional_params.emplace_back(
|
||||
base::UTF8ToUTF16("nacl"), base::UTF8ToUTF16(iter->url.spec()));
|
||||
u"nacl", base::UTF8ToUTF16(iter->url.spec()));
|
||||
info.mime_types.emplace_back(std::move(mime_type_info));
|
||||
}
|
||||
|
||||
|
@ -82,7 +82,7 @@ TEST_F(HistoryTabHelperTest, ShouldUpdateTitleInHistory) {
|
||||
web_contents()->GetController().GetLastCommittedEntry();
|
||||
ASSERT_NE(nullptr, entry);
|
||||
|
||||
web_contents()->UpdateTitleForEntry(entry, base::UTF8ToUTF16("title1"));
|
||||
web_contents()->UpdateTitleForEntry(entry, u"title1");
|
||||
EXPECT_EQ("title1", QueryPageTitleFromHistory(page_url_));
|
||||
}
|
||||
|
||||
@ -103,7 +103,7 @@ TEST_F(HistoryTabHelperTest, ShouldLimitTitleUpdatesPerPage) {
|
||||
ASSERT_EQ("title10", QueryPageTitleFromHistory(page_url_));
|
||||
|
||||
// Furhter updates should be ignored.
|
||||
web_contents()->UpdateTitleForEntry(entry, base::UTF8ToUTF16("title11"));
|
||||
web_contents()->UpdateTitleForEntry(entry, u"title11");
|
||||
EXPECT_EQ("title10", QueryPageTitleFromHistory(page_url_));
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user