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

Side by Side Diff: ui/base/win/osk_display_manager_unittest.cc

Issue 1986153005: The on screen keyboard on Windows 8+ should not obscure the input field. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address sky unittest review comments Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/base/win/osk_display_manager.cc ('k') | ui/base/win/osk_display_observer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ui/base/win/osk_display_manager.h"
6
7 #include "base/files/file_path.h"
8 #include "base/files/file_util.h"
9 #include "base/logging.h"
10 #include "base/macros.h"
11 #include "base/strings/string16.h"
12 #include "testing/gtest/include/gtest/gtest.h"
13
14 // This test validates the on screen keyboard path (tabtip.exe) which is read
15 // from the registry.
16 TEST(OnScreenKeyboardTest, OSKPath) {
17 ui::OnScreenKeyboardDisplayManager* keyboard_display_manager =
18 ui::OnScreenKeyboardDisplayManager::GetInstance();
19 EXPECT_NE(nullptr, keyboard_display_manager);
20
21 base::string16 osk_path;
22 EXPECT_TRUE(keyboard_display_manager->GetOSKPath(&osk_path));
23 EXPECT_FALSE(osk_path.empty());
24 EXPECT_TRUE(osk_path.find(L"tabtip.exe") != base::string16::npos);
25
26 // The path read from the registry can be quoted. To check for the existence
27 // of the file we use the base::PathExists function which internally uses the
28 // GetFileAttributes API which does not accept quoted strings. Our workaround
29 // is to look for quotes in the first and last position in the string and
30 // erase them.
31 if ((osk_path.front() == L'"') && (osk_path.back() == L'"'))
32 osk_path = osk_path.substr(1, osk_path.size() - 2);
33
34 EXPECT_TRUE(base::PathExists(base::FilePath(osk_path)));
35 }
OLDNEW
« no previous file with comments | « ui/base/win/osk_display_manager.cc ('k') | ui/base/win/osk_display_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698