后囟门什么时候闭合| 灵魂是什么| 大腿肌肉酸痛是什么病| 比肩什么意思| 刑警队是干什么的| 法大大是什么| 无创dna是检查什么的| 世界上最高的塔是什么塔| 川芎有什么功效与作用| 院士是什么级别| 小厮是什么意思| 骨质疏松挂什么科| 左小腿麻木是什么原因| 犄角旮旯是什么意思| 辣的部首是什么| 朱雀是什么| 妈富隆是什么药| 吃什么头发长得快| 万箭穿心是什么意思| 吃饭时头晕是什么原因| 6月7日什么星座| 写字楼是干什么的| 知道是什么意思| 硅胶是什么材质| 眼压是什么意思| 2039年是什么年| 为什么天气热皮肤就痒| 黄瓜吃多了有什么坏处| 艾滋病是什么病毒| 虾仁和什么炒好吃| 老九门2什么时候上映| 有色眼镜是什么意思| 百合是什么植物| 阴阳互补什么意思| 人彘是什么| 厦门房价为什么那么高| 舌头苦是什么原因| 明天是什么节日| eod是什么意思| 为什么会焦虑| 用你的手解我的锁是什么歌| 浊气是什么意思| 工匠精神的核心是什么| 高压氧是什么| 血氧仪是干什么用的| 砷是什么东西| 三毛为什么自杀| 查血清能查出什么病| 蛇缠腰是什么病怎么治| 子宫附件包括什么| 宫腔内无回声区是什么意思| 右眼皮跳是什么预兆| 去香港自由行要办什么手续| 为什么感冒喝白酒好了| 6月14日什么星座| 什么是乳胶床垫| 二刷是什么意思| 未属什么五行| 猪心炖什么补气补血| gag是什么意思| 不自觉摇头是什么病| 凝血五项是检查什么病| 血脂高是什么原因引起| 补办医保卡需要什么资料| bml什么意思| 9月12号是什么星座| 93年属什么今年多大| 有什么好吃的家常菜| 检查颈椎挂什么科| 关塔那摩监狱为什么在古巴| ib是什么单位| 粉头是什么意思| 逍遥丸的功效和作用是什么| 什么东西晚上才生出尾巴| cdfl是什么意思| 清华大学前身叫什么| 嘴巴里苦是什么原因| 什么水果可以降火| 琬字五行属什么| 为什么香蕉不能放冰箱| 戒定真香是什么意思| 避重就轻是什么意思| 左束支传导阻滞是什么意思| 美食家是什么意思| 小孩舌头白是什么原因| 身上痒是什么原因引起的| 女儿茶属于什么茶| 服装属于五行什么行业| 学制是什么| 陪嫁一般陪些什么东西| 脑供血不足头晕吃什么药| 高铁动车有什么区别| 工口什么意思| 肛门胀痛什么原因| 半夜是什么时辰| 多普勒超声检查是什么| 吃什么可以壮阳| 小子是什么意思| 三乙醇胺是什么东西| 打胰岛素有什么副作用| 甲减吃什么药| 清明节吃什么好| 血热吃什么| 半夜喉咙痒咳嗽是什么原因| 女性喝什么利尿最快| 蛋白尿吃什么药| 维生素c阴性什么意思| 猫吃什么下奶最快最多| 蓬蒿人是什么意思| 去湿气喝什么| 红和绿混合是什么颜色| 容易出汗什么原因| 膀胱壁增厚是什么原因| 在岸人民币和离岸人民币什么意思| 痛风什么感觉| 全麦粉是什么面粉| 龋读什么| 夏天适合养什么花| 眼压高吃什么药| 1958年属什么生肖| 风采依旧是什么意思| 脆生生是什么意思| 虾仁和什么炒好吃| 县长是什么级别| 边界是什么意思| 为什么喝咖啡会拉肚子| 口干舌燥挂什么科| 胸膜炎什么症状| 什么东西天气越热它爬得越高| 资生堂属于什么档次| 乙肝对身体有什么影响| 蒸馏水是什么水| 手肿脚肿是什么原因引起的| 蓝色的小药丸是什么药| 胎盘位于子宫后壁是什么意思| 兆后面是什么单位| 蛇床子是什么| 胆碱能性荨麻疹吃什么药| 金牛女喜欢什么样的男生| 中药什么时间喝效果最好| 什么是二型糖尿病| 漠漠什么意思| 更年期提前是什么症状| 痛风挂什么科| 天狗是什么意思| 朋友圈提到了我是什么意思| 奶篓子是什么意思| 领结婚证需要什么| 附件是什么意思| 吃什么能排出胆结石| 什么叫阵雨| 全麦粉和小麦粉的区别是什么| 妈妈咪呀是什么意思| 生水是什么意思| 阿奇霉素是什么药| 一蹴而就什么意思| 睡眠不好挂什么科门诊| 师级干部是什么级别| 眼睛为什么会近视| 月经量少吃什么调理最好方法| 石灰的主要成分是什么| 补血吃什么食物| 老年人腿无力是什么原因导致的| 启读什么| 冬虫虫念什么| 活动性肺结核是什么意思| 天贵星是什么意思| 老年人打嗝不止是什么原因| 齁是什么意思| 识大体是什么意思| 樱桃补什么| 禾加农是什么字| 高血压会引起什么病症| 脾胃虚寒吃什么食物好| 胆固醇偏高吃什么好| 为什么会梦到前男友| 女生的胸长什么样| 五浊恶世是什么意思| 什么是跳蛋| 恶心头晕是什么症状| 什么什么鼎沸| 紧锣密鼓是什么意思| 维生素b2治什么病| 动爻是什么意思| 血小板数目偏高是什么意思| 肝火旺是什么症状| 胃结石有什么症状表现| 眉毛上的痣代表什么| 鞭挞是什么意思| 青葱岁月是什么意思| 稀料对人体有什么危害| 拔牙后可以吃什么| 等闲识得东风面下一句是什么| 水光是什么| 梦见自己流鼻血是什么预兆| 黑t恤搭配什么裤子| 梦到老鼠是什么意思| 霍启刚家族做什么生意| 七夕送什么礼物好| 国家副主席是什么级别| 水痘疫苗叫什么| 无创什么时候出结果| 手指关节痛什么原因| 山开念什么| 肠胃不好吃什么药好| 眉心发红是什么原因| 地中海贫血是什么原因引起的| 腰椎间盘突出挂什么科室| 起床口苦是什么原因| 郫县豆瓣酱能做什么菜| 宫颈息肉有什么危害| 狐假虎威是什么意思| 颂字五行属什么| 喝什么茶去火排毒祛痘| 医保卡什么样子| 一直打嗝吃什么药| 乳腺结节三级是什么意思| 为什么会铅中毒| 斑是什么原因造成的| 全脂奶粉是什么意思| crp高是什么感染| 种猪是什么意思| 蜗牛吃什么东西| 潘驴邓小闲是什么意思| 受委屈是什么意思| 装牙套有什么坏处| 老干部是什么意思| 李志为什么| 眼红是什么意思| 打胎用什么药| 至加秦是什么字| 脑供血不足吃什么食物| r0lex是什么牌子手表| 子宫下垂是什么症状| 流口水是什么原因| 64年属什么生肖| 医院五行属什么| 复古红是什么颜色| 为什么天气热皮肤就痒| 自由基是什么| 女宝胶囊的作用和功效是什么| 梦到明星是什么意思| 水飞蓟是什么| 吃什么凉血效果最好| 弥月之喜是什么意思| 6月份是什么星座的| 什么思而行| 透析是什么原理| 沉积是什么意思| 什么人不能念阿弥陀佛| 鼎字五行属什么| 郡肝是什么部位| 妃嫔是什么意思| 魑魅魍魉是什么意思| rag是什么| 粉色是什么颜色配成的| 吊膀子是什么意思| 吕布的马叫什么| 空虚是什么意思| 新加坡用什么货币| 5s是什么| 村支部书记是什么级别| 圣罗兰是什么档次| 你算个什么东西| 百度
blob: 192258e8c1ff872e0f68713fb2bf15880c28af63 [file] [log] [blame]
#!/usr/bin/env vpython3
# Copyright 2024 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Test the captured sites Commands."""
import os
from pathlib import Path
import unittest
import captured_sites_commands
class UnitTestCapturedSitesCommands(unittest.TestCase):
def createAndSetEnvDirectory(self, env_name, dir_name):
full_dir_path = Path(dir_name)
if not full_dir_path.exists():
os.makedirs(full_dir_path, exist_ok=True)
self.local_environ[env_name] = dir_name
def setUp(self):
self.local_environ = os.environ.copy()
self.createAndSetEnvDirectory('CAPTURED_SITES_USER_DATA_DIR',
'/tmp/captured_sites/userdir')
self.createAndSetEnvDirectory('CAPTURED_SITES_LOG_DATA_DIR',
'/tmp/captured_sites/local_test_results')
def buildReturnCommandText(self, name, args):
command = captured_sites_commands.initiate_command(name, self.local_environ)
command.build(args)
return command.print()
def helpCompareInputsToExpected(self, actual_input_and_output):
for i, [name, args, expected_print] in enumerate(actual_input_and_output):
identifier = ' '.join([name] + args)
with self.subTest(command=identifier):
actual_print = self.buildReturnCommandText(name, args)
print(name, args)
self.assertEqual(actual_print, expected_print)
def testBuildCommand(self):
actual_input_and_output = [
[
'build', [],
'autoninja -C out/Default captured_sites_interactive_tests'
],
[
'build', ['-r'],
'autoninja -C out/Release captured_sites_interactive_tests'
],
]
self.helpCompareInputsToExpected(actual_input_and_output)
def testChromeCommand(self):
actual_input_and_output = [
[
'chrome', [],
('/usr/bin/google-chrome --ignore-certificate-errors-spki-list=2HcX'
'CSKKJS0lEXLQEWhpHUfGuojiU0tiT5gOF9LP6IQ=,PoNnQAwghMiLUPg1YNFtvTfG'
'reNT8r9oeLEyzgNCJWc= --user-data-dir="/tmp/captured_sites/userdir'
'" --disable-application-cache --show-autofill-signatures --enable'
'-features=AutofillShowTypePredictions --disable-features=Autofill'
'CacheQueryResponses')
],
[
'chrome', ['-r'],
('out/Release/chrome --ignore-certificate-errors-spki-list=2HcXCSKK'
'JS0lEXLQEWhpHUfGuojiU0tiT5gOF9LP6IQ=,PoNnQAwghMiLUPg1YNFtvTfGreNT'
'8r9oeLEyzgNCJWc= --user-data-dir="/tmp/captured_sites/userdir" --'
'disable-application-cache --show-autofill-signatures --enable-fea'
'tures=AutofillShowTypePredictions --disable-features=AutofillCach'
'eQueryResponses')
],
[
'chrome', ['-w'],
('/usr/bin/google-chrome --ignore-certificate-errors-spki-list=2HcX'
'CSKKJS0lEXLQEWhpHUfGuojiU0tiT5gOF9LP6IQ=,PoNnQAwghMiLUPg1YNFtvTfG'
'reNT8r9oeLEyzgNCJWc= --user-data-dir="/tmp/captured_sites/userdir'
'" --disable-application-cache --show-autofill-signatures --enable'
'-features=AutofillShowTypePredictions --disable-features=Autofill'
'CacheQueryResponses --host-resolver-rules="MAP *:80 127.0.0.1:808'
'0,MAP *:443 127.0.0.1:8081,EXCLUDE localhost"')
],
[
'chrome', ['-r', '-w'],
('out/Release/chrome --ignore-certificate-errors-spki-list=2HcXCSKK'
'JS0lEXLQEWhpHUfGuojiU0tiT5gOF9LP6IQ=,PoNnQAwghMiLUPg1YNFtvTfGreNT'
'8r9oeLEyzgNCJWc= --user-data-dir="/tmp/captured_sites/userdir" --'
'disable-application-cache --show-autofill-signatures --enable-fea'
'tures=AutofillShowTypePredictions --disable-features=AutofillCach'
'eQueryResponses --host-resolver-rules="MAP *:80 127.0.0.1:8080,MA'
'P *:443 127.0.0.1:8081,EXCLUDE localhost"')
],
]
self.helpCompareInputsToExpected(actual_input_and_output)
def testWprCommand(self):
actual_input_and_output = [
[
'wpr', ['record', 'google'],
('third_party/catapult/telemetry/telemetry/bin/linux/x86_64/wpr rec'
'ord --http_port=8080 --http_port=8081 --inject_scripts=third_par'
'ty/catapult/web_page_replay_go/deterministic.js,chrome/test/data/'
'web_page_replay_go_helper_scripts/automation_helper.js --http_ce'
'rt_file=components/test/data/autofill/web_page_replay_support_fil'
'es/ecdsa_cert.pem,components/test/data/autofill/web_page_replay_s'
'upport_files/wpr_cert.pem --http_key_file=components/test/data/a'
'utofill/web_page_replay_support_files/ecdsa_key.pem,components/te'
'st/data/autofill/web_page_replay_support_files/wpr_key.pem chrome'
'/test/data/autofill/captured_sites/artifacts/google.wpr')
],
[
'wpr', ['record', '-c', 'rsa', 'google'],
('third_party/catapult/telemetry/telemetry/bin/linux/x86_64/wpr rec'
'ord --http_port=8080 --http_port=8081 --inject_scripts=third_par'
'ty/catapult/web_page_replay_go/deterministic.js,chrome/test/data/'
'web_page_replay_go_helper_scripts/automation_helper.js --http_ce'
'rt_file=components/test/data/autofill/web_page_replay_support_fil'
'es/wpr_cert.pem --http_key_file=components/test/data/autofill/we'
'b_page_replay_support_files/wpr_key.pem chrome/test/data/autofill'
'/captured_sites/artifacts/google.wpr')
],
[
'wpr', ['replay', 'google'],
('third_party/catapult/telemetry/telemetry/bin/linux/x86_64/wpr rep'
'lay --http_port=8080 --http_port=8081 --inject_scripts=third_par'
'ty/catapult/web_page_replay_go/deterministic.js,chrome/test/data/'
'web_page_replay_go_helper_scripts/automation_helper.js --serve_re'
'sponse_in_chronological_sequence --http_cert_file=components/tes'
't/data/autofill/web_page_replay_support_files/ecdsa_cert.pem,comp'
'onents/test/data/autofill/web_page_replay_support_files/wpr_cert.'
'pem --http_key_file=components/test/data/autofill/web_page_repla'
'y_support_files/ecdsa_key.pem,components/test/data/autofill/web_p'
'age_replay_support_files/wpr_key.pem chrome/test/data/autofill/ca'
'ptured_sites/artifacts/google.wpr')
],
[
'wpr', ['replay', 'sign_in_pass', 'google'],
('third_party/catapult/telemetry/telemetry/bin/linux/x86_64/wpr rep'
'lay --http_port=8080 --http_port=8081 --inject_scripts=third_par'
'ty/catapult/web_page_replay_go/deterministic.js,chrome/test/data/'
'web_page_replay_go_helper_scripts/automation_helper.js --serve_re'
'sponse_in_chronological_sequence --http_cert_file=components/tes'
't/data/autofill/web_page_replay_support_files/ecdsa_cert.pem,comp'
'onents/test/data/autofill/web_page_replay_support_files/wpr_cert.'
'pem --http_key_file=components/test/data/autofill/web_page_repla'
'y_support_files/ecdsa_key.pem,components/test/data/autofill/web_p'
'age_replay_support_files/wpr_key.pem chrome/test/data/password/ca'
'ptured_sites/artifacts/sign_in_pass/google.wpr')
],
[
'wpr', ['replay', '-c', 'rsa', 'google'],
('third_party/catapult/telemetry/telemetry/bin/linux/x86_64/wpr rep'
'lay --http_port=8080 --http_port=8081 --inject_scripts=third_par'
'ty/catapult/web_page_replay_go/deterministic.js,chrome/test/data/'
'web_page_replay_go_helper_scripts/automation_helper.js --serve_re'
'sponse_in_chronological_sequence --http_cert_file=components/tes'
't/data/autofill/web_page_replay_support_files/wpr_cert.pem --http'
's_key_file=components/test/data/autofill/web_page_replay_support_'
'files/wpr_key.pem chrome/test/data/autofill/captured_sites/artifa'
'cts/google.wpr')
],
]
self.helpCompareInputsToExpected(actual_input_and_output)
def testRefreshCommand(self):
actual_input_and_output = [
[
'refresh', ['google'],
('out/Default/captured_sites_interactive_tests --gtest_filter="*/Au'
'tofillCapturedSitesRefresh.Recipe/google" --enable-pixel-output-i'
'n-tests --test-launcher-interactive --vmodule=captured_sites_test'
'_utils=2,cache_replayer=1,autofill_captured_sites_interactive_uit'
'est=1')
],
[
'refresh', ['-r', 'google'],
('out/Release/captured_sites_interactive_tests --gtest_filter="*/Au'
'tofillCapturedSitesRefresh.Recipe/google" --enable-pixel-output-i'
'n-tests --test-launcher-interactive --vmodule=captured_sites_test'
'_utils=2,cache_replayer=1,autofill_captured_sites_interactive_uit'
'est=1')
],
[
'refresh', ['-b', 'google'],
('testing/xvfb.py out/Default/captured_sites_interactive_tests --gt'
'est_filter="*/AutofillCapturedSitesRefresh.Recipe/google" --enabl'
'e-pixel-output-in-tests --test-launcher-interactive --vmodule=cap'
'tured_sites_test_utils=2,cache_replayer=1,autofill_captured_sites'
'_interactive_uitest=1')
],
[
'refresh', ['-r', '-s', 'google'],
('out/Release/captured_sites_interactive_tests --gtest_filter="*/Au'
'tofillCapturedSitesRefresh.Recipe/google" --enable-pixel-output-i'
'n-tests --test-launcher-interactive --vmodule=captured_sites_test'
'_utils=2,cache_replayer=1,autofill_captured_sites_interactive_uit'
'est=1 --test-launcher-summary-output=/tmp/captured_sites/local_te'
'st_results/google_output.json 2>&1 | tee /tmp/captured_sites/loca'
'l_test_results/google_capture.log')
],
[
'refresh',
[
'-r', '-s', '-b', '-d', '-f', '-v', '-t', '5', '-a', 'c', '-q',
'pipe', '-w', 'google'
],
('testing/xvfb.py out/Release/captured_sites_interactive_tests --gt'
'est_filter="*/AutofillCapturedSitesRefresh.Recipe/google" --enabl'
'e-pixel-output-in-tests --test-launcher-interactive --vmodule=cap'
'tured_sites_test_utils=2,autofill_download_manager=1,form_cache=1'
',autofill_agent=1,autofill_handler=1,form_structure=1,cache_repla'
'yer=2,autofill_captured_sites_interactive_uitest=1 --gtest_also_r'
'un_disabled_tests --gtest_break_on_failure --wpr_verbose --test-l'
'auncher-retry-limit=5 --autofill-server-type=SavedCache --comman'
'd_file=pipe --test-launcher-summary-output=/tmp/captured_sites/lo'
'cal_test_results/google_output.json 2>&1 | tee /tmp/captured_site'
's/local_test_results/google_capture.log')
],
]
self.helpCompareInputsToExpected(actual_input_and_output)
def testRunCommand(self):
actual_input_and_output = [
[
'run', ['google'],
('out/Default/captured_sites_interactive_tests --gtest_filter="*/Au'
'tofillCapturedSitesInteractiveTest.Recipe/google" --enable-pixel-'
'output-in-tests --test-launcher-interactive --vmodule=captured_si'
'tes_test_utils=2,cache_replayer=1,autofill_captured_sites_interac'
'tive_uitest=1')
],
[
'run', ['-r', 'google'],
('out/Release/captured_sites_interactive_tests --gtest_filter="*/Au'
'tofillCapturedSitesInteractiveTest.Recipe/google" --enable-pixel-'
'output-in-tests --test-launcher-interactive --vmodule=captured_si'
'tes_test_utils=2,cache_replayer=1,autofill_captured_sites_interac'
'tive_uitest=1')
],
[
'run', ['-b', 'google'],
('testing/xvfb.py out/Default/captured_sites_interactive_tests --gt'
'est_filter="*/AutofillCapturedSitesInteractiveTest.Recipe/google"'
' --enable-pixel-output-in-tests --test-launcher-interactive --vmo'
'dule=captured_sites_test_utils=2,cache_replayer=1,autofill_captur'
'ed_sites_interactive_uitest=1')
],
[
'run', ['-r', '-s', 'google'],
('out/Release/captured_sites_interactive_tests --gtest_filter="*/Au'
'tofillCapturedSitesInteractiveTest.Recipe/google" --enable-pixel-'
'output-in-tests --test-launcher-interactive --vmodule=captured_si'
'tes_test_utils=2,cache_replayer=1,autofill_captured_sites_interac'
'tive_uitest=1 --test-launcher-summary-output=/tmp/captured_sites/'
'local_test_results/google_output.json 2>&1 | tee /tmp/captured_si'
'tes/local_test_results/google_capture.log')
],
[
'run', ['-r', '-s', '-u', 'google'],
('out/Release/captured_sites_interactive_tests --gtest_filter="*/Au'
'tofillCapturedSitesInteractiveTest.Recipe/google" --enable-pixel-'
'output-in-tests --ui-test-action-max-timeout=180000 --test-launch'
'er-timeout=180000 --vmodule=captured_sites_test_utils=2,cache_rep'
'layer=1,autofill_captured_sites_interactive_uitest=1 --test-launc'
'her-summary-output=/tmp/captured_sites/local_test_results/google_'
'output.json 2>&1 | tee /tmp/captured_sites/local_test_results/goo'
'gle_capture.log')
],
[
'run',
[
'-r', '-s', '-b', '-d', '-f', '-v', '-t', '5', '-a', 'c', '-q',
'pipe', '-w', 'google'
],
('testing/xvfb.py out/Release/captured_sites_interactive_tests --gt'
'est_filter="*/AutofillCapturedSitesInteractiveTest.Recipe/google"'
' --enable-pixel-output-in-tests --test-launcher-interactive --vmo'
'dule=captured_sites_test_utils=2,autofill_download_manager=1,form'
'_cache=1,autofill_agent=1,autofill_handler=1,form_structure=1,cac'
'he_replayer=2,autofill_captured_sites_interactive_uitest=1 --gtes'
't_also_run_disabled_tests --gtest_break_on_failure --wpr_verbose '
'--test-launcher-retry-limit=5 --autofill-server-type=SavedCache '
'--command_file=pipe --test-launcher-summary-output=/tmp/captured_'
'sites/local_test_results/google_output.json 2>&1 | tee /tmp/captu'
'red_sites/local_test_results/google_capture.log')
],
]
self.helpCompareInputsToExpected(actual_input_and_output)
if __name__ == '__main__':
unittest.main()
咳嗽两个月了一直不好是什么原因 炉中火是什么意思 2010年是什么命 细佬是什么意思 付肾是什么药
女人肺气虚吃什么补最快 维c什么时候吃效果最好 mrv是什么检查 左心房扩大是什么意思 肝肾挂什么科
脂肪肝吃什么药最好 什么心什么胆 经常闪腰是什么原因引起的 歧途什么意思 智齿疼吃什么药最管用
2019年什么生肖 陶和瓷有什么区别 四月十四日是什么节日 轻微脑震荡有什么症状 蜜蜂为什么要采蜜
58年属什么今年多大hcv7jop4ns8r.cn 民政局是干什么的hcv8jop9ns9r.cn 果酸有什么作用hcv7jop9ns7r.cn 患难见真情是什么意思hcv7jop9ns9r.cn 事无巨细什么意思hcv9jop1ns1r.cn
白无常叫什么名字hcv7jop9ns7r.cn 婴儿八个月可以吃什么辅食hcv9jop8ns2r.cn 一动就大汗淋漓是什么原因hcv8jop4ns3r.cn 天庭饱满是什么意思xianpinbao.com 什么补肾最好hcv8jop3ns4r.cn
血尿是什么原因引起的kuyehao.com 胎盘位于子宫前壁是什么意思hcv8jop0ns1r.cn 脖子落枕挂什么科yanzhenzixun.com 螳螂捕蝉什么意思hcv9jop0ns5r.cn 人为什么需要诗歌hcv9jop4ns0r.cn
肚子拉稀像水一样是什么情况hcv8jop3ns8r.cn 人造石是什么材料做的hcv9jop4ns3r.cn 脚抽筋是什么原因hcv9jop7ns9r.cn 怀疑心衰做什么检查beikeqingting.com 贫血不能吃什么wuhaiwuya.com
百度