[go: nahoru, domu]

tree: 4544910a479743d937ead9d35aa9e42486527b38 [path history] [tgz]
  1. accelerators/
  2. accessibility/
  3. animation/
  4. app_list/
  5. assistant/
  6. autoclick/
  7. components/
  8. content/
  9. dbus/
  10. detachable_base/
  11. display/
  12. drag_drop/
  13. events/
  14. first_run/
  15. frame/
  16. high_contrast/
  17. highlighter/
  18. host/
  19. ime/
  20. keyboard/
  21. laser/
  22. lock_screen_action/
  23. login/
  24. magnifier/
  25. message_center/
  26. metrics/
  27. multi_device_setup/
  28. perftests/
  29. policy/
  30. public/
  31. resources/
  32. rotator/
  33. session/
  34. shelf/
  35. shell/
  36. sidebar/
  37. sticky_keys/
  38. strings/
  39. system/
  40. test/
  41. tooltips/
  42. touch/
  43. touch_hud/
  44. tray_action/
  45. utility/
  46. voice_interaction/
  47. wallpaper/
  48. wayland/
  49. wm/
  50. ws/
  51. app_launch_unittest.cc
  52. ash_export.h
  53. ash_service.cc
  54. ash_service.h
  55. ash_strings.grd
  56. ash_view_ids.h
  57. BUILD.gn
  58. cancel_mode.cc
  59. cancel_mode.h
  60. cast_config_controller.cc
  61. cast_config_controller.h
  62. debug.cc
  63. debug.h
  64. DEPS
  65. dip_unittest.cc
  66. disconnected_app_handler.cc
  67. disconnected_app_handler.h
  68. event_matcher_util.cc
  69. event_matcher_util.h
  70. extended_desktop_unittest.cc
  71. focus_cycler.cc
  72. focus_cycler.h
  73. focus_cycler_unittest.cc
  74. login_status.h
  75. main.cc
  76. manifest.json
  77. media_controller.cc
  78. media_controller.h
  79. mojo_interface_factory.cc
  80. mojo_interface_factory.h
  81. mojo_test_interface_factory.cc
  82. mojo_test_interface_factory.h
  83. multi_profile_uma.cc
  84. multi_profile_uma.h
  85. mus_property_mirror_ash_unittest.cc
  86. network_connect_delegate_mus.cc
  87. network_connect_delegate_mus.h
  88. new_window_controller.cc
  89. new_window_controller.h
  90. note_taking_controller.cc
  91. note_taking_controller.h
  92. OWNERS
  93. pointer_watcher_adapter_classic.cc
  94. pointer_watcher_adapter_classic.h
  95. pointer_watcher_adapter_classic_unittest.cc
  96. README.md
  97. root_window_controller.cc
  98. root_window_controller.h
  99. root_window_controller_unittest.cc
  100. root_window_settings.cc
  101. root_window_settings.h
  102. scoped_root_window_for_new_windows.cc
  103. scoped_root_window_for_new_windows.h
  104. screen_util.cc
  105. screen_util.h
  106. screen_util_unittest.cc
  107. screenshot_delegate.h
  108. shell.cc
  109. shell.h
  110. shell_delegate.h
  111. shell_delegate_mus.cc
  112. shell_delegate_mus.h
  113. shell_init_params.cc
  114. shell_init_params.h
  115. shell_observer.h
  116. shell_port.cc
  117. shell_port.h
  118. shell_port_classic.cc
  119. shell_port_classic.h
  120. shell_port_mash.cc
  121. shell_port_mash.h
  122. shell_port_mus.cc
  123. shell_port_mus.h
  124. shell_test_api.cc
  125. shell_test_api.h
  126. shell_unittest.cc
  127. shutdown_controller.cc
  128. shutdown_controller.h
  129. shutdown_reason.cc
  130. shutdown_reason.h
  131. test_media_client.cc
  132. test_media_client.h
  133. test_screenshot_delegate.cc
  134. test_screenshot_delegate.h
  135. test_shell_delegate.cc
  136. test_shell_delegate.h
  137. virtual_keyboard_container_layout_manager.cc
  138. virtual_keyboard_container_layout_manager.h
  139. virtual_keyboard_controller.cc
  140. virtual_keyboard_controller.h
  141. virtual_keyboard_controller_unittest.cc
  142. window_manager.cc
  143. window_manager.h
  144. window_manager_common_unittests.cc
  145. window_manager_service.cc
  146. window_manager_service.h
  147. window_manager_unittest.cc
  148. window_user_data.h
  149. window_user_data_unittest.cc
ash/README.md

Ash

Ash is the “Aura Shell”, the window manager and system UI for Chrome OS. Ash uses the views UI toolkit (e.g. views::View, views::Widget, etc.) backed by the aura native widget and layer implementations.

Ash sits below chrome in the dependency graph (i.e. it cannot depend on code in //chrome). It has a few dependencies on //content, but these are isolated in their own module in //ash/content. This allows targets like ash_unittests to build more quickly.

Tests

Most tests should be added to the ash_unittests target. Tests that rely on //content should be added to ash_content_unittests, but these should be rare.

Tests can bring up most of the ash UI and simulate a login session by deriving from AshTestBase. This is often needed to test code that depends on ash::Shell and the controllers it owns.

Test support code (TestFooDelegate, FooControllerTestApi, etc.) lives in the same directory as the class under test (e.g. //ash/foo rather than //ash/test). Test code uses namespace ash; there is no special “test” namespace.

Mustash

Ash is transitioning to run as a mojo service in its own process. This change means that code in chrome cannot call into ash directly, but must use the mojo interfaces in //ash/public/interfaces.

Out-of-process Ash is referred to as “mash” (mojo ash). In-process ash is referred to as “classic ash”. Ash can run in either mode depending on the --enable-features=Mash command line flag.

In the few cases where chrome code is allowed to call into ash (e.g. code that will only ever run in classic ash) the #include lines have “// mash-ok” appended. This makes it easier to use grep to determine which parts of chrome have not yet been adapted to mash.

Ash used to support a “mus” mode that ran the mojo window service from //services/ui on a background thread in the browser process. This configuration was deprecated in April 2018.

Mustash Tests

ash_unittests --enable-features=Mash runs in mash mode. Some tests will fail because the underlying code has not yet been ported to work with mash. We use filter files to skip these tests, because it makes it easier to run the entire suite without the filter to see what passes.

To simulate what the bots run (e.g. to check if you broke an existing test that works under mash) you can run:

ash_unittests --enable-features=Mash --test-launcher-filter-file=testing/buildbot/filters/mash.ash_unittests.filter

There is a similar filter file for browser_tests --enable-features=Mash.

Any new feature you add (and its tests) should work under mash. If your test cannot pass under mash due to some dependency being broken you may add the test to the filter file. Make sure there is a bug for the underlying issue and cite it in the filter file.

Prefs

Ash supports both per-user prefs and device-wide prefs. These are called “profile prefs” and “local state” to match the naming conventions in chrome. Ash also supports “signin screen” prefs, bound to a special profile that allows users to toggle features like spoken feedback at the login screen.

Local state prefs are loaded asynchronously during startup. User prefs are loaded asynchronously after login, and after adding a multiprofile user. Code that wants to observe prefs must wait until they are loaded. See ShellObserver::OnLocalStatePrefServiceInitialized() and SessionObserver::OnActiveUserPrefServiceChanged(). All PrefService objects exist for the lifetime of the login session, including the signin prefs.

Pref names are in //ash/public/cpp so that code in chrome can also use the names. Prefs are registered in the classes that use them because those classes have the best knowledge of default values.

All PrefService instances in ash are backed by the mojo preferences service. This means an update to a pref is asynchronous between code in ash and code in chrome. For example, if code in chrome changes a pref value then immediately calls a C++ function in ash, that ash function may not see the new value yet. (This pattern only happens in the classic ash configuration; code in chrome cannot call directly into the ash process in the mash config.)

Prefs are either “owned” by ash or by chrome browser. New prefs used by ash should be owned by ash. See NightLightController and LogoutButtonTray for examples of ash-owned prefs. See //services/preferences/README.md for details of pref ownership and “foreign” prefs.

Historical notes

Ash shipped on Windows for a couple years to support Windows 8 Metro mode. Windows support was removed in 2016.