OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 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 #include "base/bind.h" | |
6 #include "base/macros.h" | |
7 #include "chrome/browser/ui/browser.h" | |
8 #include "chrome/browser/ui/browser_dialogs.h" | |
9 #include "chrome/browser/ui/test/test_browser_dialog.h" | |
10 #include "chrome/browser/ui/views/extensions/request_file_system_dialog_view.h" | |
11 #include "chrome/test/base/in_process_browser_test.h" | |
12 #include "content/public/test/browser_test.h" | |
13 #include "testing/gmock/include/gmock/gmock.h" | |
14 #include "testing/gtest/include/gtest/gtest.h" | |
15 | |
16 namespace { | |
17 | |
18 // Helper class to display the RequestFileSystemDialogView dialog for testing. | |
19 class RequestFileSystemDialogTest : public DialogBrowserTest { | |
20 public: | |
21 RequestFileSystemDialogTest() {} | |
22 | |
23 void ShowDialog(const std::string& name) override { | |
24 auto* web_contents = browser()->tab_strip_model()->GetActiveWebContents(); | |
Peter Kasting
2017/04/27 01:08:05
Nit: Unused local
ananta
2017/04/27 01:29:52
Done.
| |
25 RequestFileSystemDialogView::ShowDialog( | |
26 browser()->tab_strip_model()->GetActiveWebContents(), | |
27 "RequestFileSystemDialogTest", | |
28 "TestVolume", | |
29 "TestVolumeId", | |
30 base::Bind(&RequestFileSystemDialogTest::DialogCallback, | |
31 base::Unretained(this)); | |
32 } | |
33 | |
34 void DialogCallback(ui::DialogButton button) {} | |
35 | |
36 private: | |
37 DISALLOW_COPY_AND_ASSIGN(SRTPromptDialogTest); | |
38 }; | |
39 | |
40 // Test that calls ShowDialog("default"). Interactive when run via | |
41 // browser_tests --gtest_filter=BrowserDialogTest.Invoke --interactive | |
42 // --dialog=TryChromeDialogTest.InvokeDialog_default | |
Peter Kasting
2017/04/27 01:08:05
Nit: Looks like most other test files omit this co
ananta
2017/04/27 01:29:52
Done.
| |
43 IN_PROC_BROWSER_TEST_F(RequestFileSystemDialogTest, InvokeDialog_default) { | |
44 RunDialog(); | |
45 } | |
46 | |
47 } // namespace | |
OLD | NEW |