Index: client/site_tests/desktopui_IBusTest/desktopui_IBusTest.py |
diff --git a/client/site_tests/desktopui_IBusTest/desktopui_IBusTest.py b/client/site_tests/desktopui_IBusTest/desktopui_IBusTest.py |
index c825ded3fd3dcd89dd3bae1bff69bcfde3cda9b6..975594540b770b380adfe33e89142a53b2d8a675 100644 |
--- a/client/site_tests/desktopui_IBusTest/desktopui_IBusTest.py |
+++ b/client/site_tests/desktopui_IBusTest/desktopui_IBusTest.py |
@@ -171,14 +171,6 @@ class desktopui_IBusTest(site_ui_test.UITest): |
'engine/PinyinLookupTableOrientation', |
'engine/PinyinSpecialPhrases', |
- # These preferences are actually read, but |
- # ibus-daemon reads them before chrome |
- # connects, so they show up as a false |
- # failure. |
- 'general/hotkeynext_engine_in_menu', |
- 'general/hotkeyprevious_engine', |
- 'generalglobal_engine', |
- |
# We don't set these prefernces. |
'general/hotkeytrigger', |
'generalembed_preedit_text', |
@@ -187,6 +179,13 @@ class desktopui_IBusTest(site_ui_test.UITest): |
'generaluse_global_engine', |
'generaluse_system_keyboard_layout']) |
+ # These preferences are actually written, but due to a race condition |
+ # on startup, they can be read by ibus-daemon before chrome connects, |
+ # and so sometimes they show up as a false failure. |
+ ignored_unwritten = set(['general/hotkeynext_engine_in_menu', |
+ 'general/hotkeyprevious_engine', |
+ 'generalglobal_engine']) |
+ |
self.preload_engines(engine_list) |
# ibus takes some time to preload the engines, and they can't be |
@@ -209,6 +208,9 @@ class desktopui_IBusTest(site_ui_test.UITest): |
actual_unread = set(re.split('\n', match.group(1).strip())) |
actual_unwritten = set(re.split('\n', match.group(2).strip())) |
+ # Filter out any preferences we're ignoring |
+ actual_unwritten.difference_update(ignored_unwritten) |
+ |
new_unread = actual_unread.difference(expected_unread) |
now_read = expected_unread.difference(actual_unread) |
new_unwritten = actual_unwritten.difference(expected_unwritten) |