data

package
v0.0.0-...-683b059 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2022 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package data contains input data and expected outcome for input tests.

Index

Constants

This section is empty.

Variables

View Source
var HandwritingMessageHello = handwritingMessage{
	ime.LanguageAr: {
		HandwritingFile: "handwriting_ar_hello.svg",
		ExpectedText:    "سلام",
	},
	ime.LanguageEn: {
		HandwritingFile: "handwriting_en_hello.svg",
		ExpectedText:    "hello",
	},
	ime.LanguageJa: {
		HandwritingFile: "handwriting_ja_hello.svg",
		ExpectedText:    "こんにちは",
	},
	ime.LanguageKo: {
		HandwritingFile: "handwriting_ko_hello.svg",
		ExpectedText:    "안녕",
	},
	ime.LanguageZhHans: {
		HandwritingFile: "handwriting_zh_hans_hello.svg",
		ExpectedText:    "你好",
	},
}

HandwritingMessageHello defines hello handwriting messages of input methods

View Source
var TypingMessageEmail = typingMessage{
	ime.EnglishUS: {
		CharacterKeySeq: []string{"t", "e", "s", "t", "@", "g", "m", "a", "i", "l", ".com"},
		ExpectedText:    "[email protected]",
	},
	ime.JapaneseWithUSKeyboard: {
		CharacterKeySeq: strings.Split("konnnitiha", ""),
		ExpectedText:    "こんにちは",
	},
	ime.ChinesePinyin: {
		CharacterKeySeq:      strings.Split("nihao", ""),
		SubmitFromSuggestion: true,
		ExpectedText:         "你好",
	},
}

TypingMessageEmail defines messages of input methods for emailInputField. Add cover for special buttons on layouts of inputs methods that are currently not available when b/192515491 is resolved.

View Source
var TypingMessageHello = typingMessage{
	ime.EnglishUS: {
		CharacterKeySeq: strings.Split("hello", ""),
		LocationKeySeq:  strings.Split("hello", ""),
		ExpectedText:    "hello",
	},
	ime.JapaneseWithUSKeyboard: {
		CharacterKeySeq: strings.Split("konnnitiha", ""),
		LocationKeySeq:  strings.Split("konnnitiha", ""),
		ExpectedText:    "こんにちは",
	},
	ime.ChinesePinyin: {
		CharacterKeySeq:      strings.Split("nihao", ""),
		LocationKeySeq:       strings.Split("nihao", ""),
		SubmitFromSuggestion: true,
		ExpectedText:         "你好",
	},
	ime.EnglishUSWithInternationalKeyboard: {
		CharacterKeySeq: strings.Split("hello", ""),
		LocationKeySeq:  strings.Split("hello", ""),
		ExpectedText:    "hello",
	},
	ime.EnglishUK: {
		CharacterKeySeq: strings.Split("hello", ""),
		LocationKeySeq:  strings.Split("hello", ""),
		ExpectedText:    "hello",
	},
	ime.EnglishSouthAfrica: {
		CharacterKeySeq: strings.Split("hello", ""),
		LocationKeySeq:  strings.Split("hello", ""),
		ExpectedText:    "hello",
	},
	ime.SpanishSpain: {
		CharacterKeySeq: strings.Split("hola", ""),
		LocationKeySeq:  strings.Split("hola", ""),
		ExpectedText:    "hola",
	},
	ime.Swedish: {
		CharacterKeySeq: strings.Split("kött", ""),
		LocationKeySeq:  strings.Split("k;tt", ""),
		ExpectedText:    "kött",
	},
	ime.EnglishCanada: {
		CharacterKeySeq: strings.Split("hello", ""),
		LocationKeySeq:  strings.Split("hello", ""),
		ExpectedText:    "hello",
	},
	ime.AlphanumericWithJapaneseKeyboard: {
		CharacterKeySeq: strings.Split("hello", ""),
		LocationKeySeq:  strings.Split("hello", ""),
		ExpectedText:    "hello",
	},
	ime.Japanese: {
		CharacterKeySeq: strings.Split("konnnitiha", ""),
		LocationKeySeq:  strings.Split("konnnitiha", ""),
		ExpectedText:    "こんにちは",
	},
	ime.FrenchFrance: {
		CharacterKeySeq: strings.Split("bonjour", ""),
		LocationKeySeq:  strings.Split("bonjour", ""),
		ExpectedText:    "bonjour",
	},
	ime.Cantonese: {
		CharacterKeySeq:      strings.Split("neihou", ""),
		LocationKeySeq:       strings.Split("neihou", ""),
		SubmitFromSuggestion: true,
		ExpectedText:         "你好",
	},
	ime.ChineseCangjie: {
		CharacterKeySeq:      strings.Split("竹手戈", ""),
		LocationKeySeq:       strings.Split("hqi", ""),
		SubmitFromSuggestion: true,
		ExpectedText:         "我",
	},
	ime.Korean: {
		CharacterKeySeq: []string{"ㅎ", "ᅡ", "ㄴ"},
		LocationKeySeq:  strings.Split("gks", ""),
		ExpectedText:    "한",
	},
	ime.Arabic: {
		CharacterKeySeq: strings.Split("سلام", ""),
		LocationKeySeq:  strings.Split("sghl", ""),
		ExpectedText:    "سلام",
	},
}

TypingMessageHello defines hello messages of input methods. TODO(b/192521170): Add data to cover that non US Eng tests would actually fail if run on the US keyboard

View Source
var TypingMessageNumber = typingMessage{
	ime.EnglishUS: {
		CharacterKeySeq: strings.Split("-123.456", ""),
		ExpectedText:    "-123.456",
	},
	ime.EnglishSouthAfrica: {
		CharacterKeySeq: strings.Split("-123.456", ""),
		ExpectedText:    "-123.456",
	},
	ime.JapaneseWithUSKeyboard: {
		CharacterKeySeq: strings.Split("-123.456", ""),
		ExpectedText:    "-123.456",
	},
	ime.ChinesePinyin: {
		CharacterKeySeq: strings.Split("-123.456", ""),
		ExpectedText:    "-123.456",
	},
}

TypingMessageNumber defines messages of input methods for numberInputField.

View Source
var TypingMessagePassword = typingMessage{
	ime.EnglishUS: {
		CharacterKeySeq: strings.Split("hello", ""),
		ExpectedText:    "hello",
	},
	ime.JapaneseWithUSKeyboard: {
		CharacterKeySeq: strings.Split("konnnitiha", ""),
		ExpectedText:    "konnnitiha",
	},
	ime.ChinesePinyin: {
		CharacterKeySeq: strings.Split("nihao", ""),
		ExpectedText:    "nihao",
	},
}

TypingMessagePassword defines messages of input methods for passwordInputField.

View Source
var TypingMessageTel = typingMessage{
	ime.EnglishUS: {
		CharacterKeySeq: []string{"-", "+", ",", ".", "(", ")", "Pause", "Wait", "N", "1", "2", "3"},
		ExpectedText:    "-+,.(),;N123",
	},
	ime.JapaneseWithUSKeyboard: {
		CharacterKeySeq: []string{"-", "+", ",", ".", "(", ")", "Pause", "Wait", "N", "1", "0"},
		ExpectedText:    "-+,.(),;N10",
	},
	ime.ChinesePinyin: {
		CharacterKeySeq: []string{"-", "+", ",", ".", "(", ")", "Pause", "Wait", "N", "1", "0"},
		ExpectedText:    "-+,.(),;N10",
	},
}

TypingMessageTel defines messages of input methods for telInputField.

View Source
var TypingMessageURL = typingMessage{
	ime.EnglishUS: {
		CharacterKeySeq: []string{"g", "o", "o", "g", "l", "e", ".com", "/"},
		ExpectedText:    "google.com/",
	},
	ime.JapaneseWithUSKeyboard: {
		CharacterKeySeq: strings.Split("konnnitiha", ""),
		ExpectedText:    "こんにちは",
	},
	ime.ChinesePinyin: {
		CharacterKeySeq:      strings.Split("nihao", ""),
		SubmitFromSuggestion: true,
		ExpectedText:         "你好",
	},
}

TypingMessageURL defines messages of input methods for urlInputField. Add cover for special buttons on layouts of inputs methods that are currently not available when b/192515491 is resolved.

View Source
var VoiceMessageHello = voiceMessage{
	ime.LanguageAr: {
		VoiceFile:    "voice_ar_hello.wav",
		ExpectedText: "السلام عليكم",
	},
	ime.LanguageEn: {
		VoiceFile:    "voice_en_hello.wav",
		ExpectedText: "hello",
	},
	ime.LanguageJa: {
		VoiceFile:    "voice_ja_hello.wav",
		ExpectedText: "こんにちは",
	},
	ime.LanguageKo: {
		VoiceFile:    "voice_ko_hello.wav",
		ExpectedText: "안녕하세요",
	},
	ime.LanguageZhHans: {
		VoiceFile:    "voice_zh_hans_hello.wav",
		ExpectedText: "你好",
	},
}

VoiceMessageHello defines hello voice messages of input methods.

Functions

func ExtractExternalFiles

func ExtractExternalFiles(messages []Message, inputMethods []ime.InputMethod) []string

ExtractExternalFiles returns the file names contained in messages for selected input methods.

Types

type InputData

type InputData struct {
	// Character-based key sequences to tap on virtual keyboards.
	CharacterKeySeq []string
	// Location-based key sequences to tap on physical keyboards.
	LocationKeySeq []string
	// Expected outcome text after input.
	ExpectedText string
	// Filename of .svg file containing handwriting strokes.
	HandwritingFile string
	// Filename of audio file containing the word voice.
	VoiceFile string
	// Whether select candidate from suggestion bar. Some IMEs need to manually
	// select from candidates to submit.
	SubmitFromSuggestion bool
}

InputData represents test data for input methods.

type Message

type Message interface {
	GetInputData(im ime.InputMethod) (InputData, bool)
}

Message is a generic type that provides a function of retrieving input data by input methods.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL