1 // Copyright 2019 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef CHROME_TEST_BASE_WINDOW_CONTENTS_AS_STRING_WIN_H_
6 #define CHROME_TEST_BASE_WINDOW_CONTENTS_AS_STRING_WIN_H_
7 
8 #include "base/strings/string16.h"
9 #include "base/win/windows_types.h"
10 
11 // Returns a string representation of the contents of |window| on the basis of
12 // the elements it exposes via UI automation, or an empty string in case of
13 // error. In particular, the control type and title of the window's element and
14 // each UI element within it is emitted, indented an amount corresponding to its
15 // depth in the UI hierarchy. Elements that are invokable (e.g., buttons) are
16 // labeled as such. For example:
17 // type: window, name: Windows can't open this type of file (.adm)
18 //   type: pane, name: Flyout window
19 //     type: pane, name:
20 //       type: pane, name: Immersive Openwith Flyout
21 //         type: text, name: Windows can't open this type of file (.adm)
22 //         type: pane, name:
23 //           type: list, name:
24 //             type: list, name:
25 //               [invokable] type: link, name: More apps
26 //         [invokable] type: button, name: OK
27 base::string16 WindowContentsAsString(HWND window_handle);
28 
29 #endif  // CHROME_TEST_BASE_WINDOW_CONTENTS_AS_STRING_WIN_H_
30