Chromium Code Reviews| Index: chrome/browser/extensions/request_file_system_dialog_browsertest.cc |
| diff --git a/chrome/browser/extensions/request_file_system_dialog_browsertest.cc b/chrome/browser/extensions/request_file_system_dialog_browsertest.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b165f7af49fb98a2db2d4263b70f6544ba77a02d |
| --- /dev/null |
| +++ b/chrome/browser/extensions/request_file_system_dialog_browsertest.cc |
| @@ -0,0 +1,47 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "base/bind.h" |
| +#include "base/macros.h" |
| +#include "chrome/browser/ui/browser.h" |
| +#include "chrome/browser/ui/browser_dialogs.h" |
| +#include "chrome/browser/ui/test/test_browser_dialog.h" |
| +#include "chrome/browser/ui/views/extensions/request_file_system_dialog_view.h" |
| +#include "chrome/test/base/in_process_browser_test.h" |
| +#include "content/public/test/browser_test.h" |
| +#include "testing/gmock/include/gmock/gmock.h" |
| +#include "testing/gtest/include/gtest/gtest.h" |
| + |
| +namespace { |
| + |
| +// Helper class to display the RequestFileSystemDialogView dialog for testing. |
| +class RequestFileSystemDialogTest : public DialogBrowserTest { |
| + public: |
| + RequestFileSystemDialogTest() {} |
| + |
| + void ShowDialog(const std::string& name) override { |
| + 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.
|
| + RequestFileSystemDialogView::ShowDialog( |
| + browser()->tab_strip_model()->GetActiveWebContents(), |
| + "RequestFileSystemDialogTest", |
| + "TestVolume", |
| + "TestVolumeId", |
| + base::Bind(&RequestFileSystemDialogTest::DialogCallback, |
| + base::Unretained(this)); |
| + } |
| + |
| + void DialogCallback(ui::DialogButton button) {} |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(SRTPromptDialogTest); |
| +}; |
| + |
| +// Test that calls ShowDialog("default"). Interactive when run via |
| +// browser_tests --gtest_filter=BrowserDialogTest.Invoke --interactive |
| +// --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.
|
| +IN_PROC_BROWSER_TEST_F(RequestFileSystemDialogTest, InvokeDialog_default) { |
| + RunDialog(); |
| +} |
| + |
| +} // namespace |