TestsFinnishQwerty.java revision 6959a0f214fc18e314f54213877956d95a1631e8
1/* 2 * Copyright (C) 2014 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package com.android.inputmethod.keyboard.layout.tests; 18 19import android.test.suitebuilder.annotation.SmallTest; 20 21import com.android.inputmethod.keyboard.layout.LayoutBase; 22import com.android.inputmethod.keyboard.layout.Qwerty; 23import com.android.inputmethod.keyboard.layout.customizer.FinnishCustomizer; 24import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder; 25 26import java.util.Locale; 27 28/** 29 * fi: Finnish/qwerty 30 */ 31@SmallTest 32public final class TestsFinnishQwerty extends LayoutTestsBase { 33 private static final Locale LOCALE = new Locale("fi"); 34 private static final LayoutBase LAYOUT = new Qwerty(new FinnishQwertyCustomizer(LOCALE)); 35 36 @Override 37 LayoutBase getLayout() { return LAYOUT; } 38 39 private static class FinnishQwertyCustomizer extends FinnishCustomizer { 40 FinnishQwertyCustomizer(final Locale locale) { super(locale); } 41 42 @Override 43 protected void setNordicKeys(final ExpectedKeyboardBuilder builder) { 44 // QWERTY layout doesn't have Nordic keys. 45 } 46 47 @Override 48 protected void setMoreKeysOfA(final ExpectedKeyboardBuilder builder) { 49 builder 50 // U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS 51 // U+00E5: "å" LATIN SMALL LETTER A WITH RING ABOVE 52 // U+00E6: "æ" LATIN SMALL LETTER AE 53 // U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE 54 // U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE 55 // U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX 56 // U+00E3: "ã" LATIN SMALL LETTER A WITH TILDE 57 // U+0101: "ā" LATIN SMALL LETTER A WITH MACRON 58 .setMoreKeysOf("a", "\u00E4", "\u00E5", "\u00E6", "\u00E0", "\u00E1", "\u00E2", 59 "\u00E3", "\u0101"); 60 } 61 62 @Override 63 protected void setMoreKeysOfO(final ExpectedKeyboardBuilder builder) { 64 builder 65 // U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS 66 // U+00F8: "ø" LATIN SMALL LETTER O WITH STROKE 67 // U+00F4: "ô" LATIN SMALL LETTER O WITH CIRCUMFLEX 68 // U+00F2: "ò" LATIN SMALL LETTER O WITH GRAVE 69 // U+00F3: "ó" LATIN SMALL LETTER O WITH ACUTE 70 // U+00F5: "õ" LATIN SMALL LETTER O WITH TILDE 71 // U+0153: "œ" LATIN SMALL LIGATURE OE 72 // U+014D: "ō" LATIN SMALL LETTER O WITH MACRON 73 .setMoreKeysOf("o", "\u00F6", "\u00F8", "\u00F4", "\u00F2", "\u00F3", "\u00F5", 74 "\u0153", "\u014D"); 75 } 76 } 77} 78