Chromium Code Reviews| Index: chrome/browser/chromeos/file_manager/file_manager_unittests_browsertests.cc |
| diff --git a/chrome/browser/chromeos/file_manager/file_manager_unittests_browsertests.cc b/chrome/browser/chromeos/file_manager/file_manager_unittests_browsertests.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c23ea8df188ec0bb22567c8561d418b870e73be1 |
| --- /dev/null |
| +++ b/chrome/browser/chromeos/file_manager/file_manager_unittests_browsertests.cc |
| @@ -0,0 +1,37 @@ |
| +// Copyright 2013 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 <vector> |
| + |
| +#include "chrome/browser/ui/browser.h" |
| +#include "chrome/browser/ui/tabs/tab_strip_model.h" |
| +#include "chrome/test/base/in_process_browser_test.h" |
| +#include "chrome/test/base/ui_test_utils.h" |
| +#include "content/public/browser/render_view_host.h" |
| +#include "content/public/browser/web_contents.h" |
| +#include "content/public/test/browser_test_utils.h" |
| +#include "grit/webui_resources.h" |
| + |
| +class FileManagerUnitTestsBrowserTest : public InProcessBrowserTest { |
| + public: |
| + // Runs all test functions in |file|, waiting for them to complete. |
| + void RunTest(const base::FilePath& file) { |
| + GURL url = ui_test_utils::GetTestUrl( |
| + base::FilePath(FILE_PATH_LITERAL("file_manager/unit_tests")), file); |
| + ui_test_utils::NavigateToURL(browser(), url); |
| + |
| + content::RenderViewHost* rvh = browser()->tab_strip_model() |
| + ->GetActiveWebContents()->GetRenderViewHost(); |
| + ASSERT_TRUE(rvh); |
|
mtomasz
2013/10/29 07:28:17
This may not return, since in a subroutine. We may
yoshiki
2013/10/31 09:07:23
I think is rvh is FALSE, the test immediately fini
mtomasz
2013/10/31 09:13:12
@hashimoto told me about this problem, so you may
yoshiki
2013/10/31 11:05:29
I asked @hashimoto and we only concluded that that
hashimoto
2013/11/01 08:15:47
As long as RunTest() is called at the last of each
yoshiki
2013/11/04 18:17:20
Sorry, I misunderstood. You're right.
|
| + |
| + const std::vector<int> empty_libraries; |
| + EXPECT_TRUE(ExecuteWebUIResourceTest(rvh, empty_libraries)); |
| + } |
| +}; |
| + |
| +IN_PROC_BROWSER_TEST_F( |
| + FileManagerUnitTestsBrowserTest, NavigationListModelTest) { |
| + RunTest(base::FilePath( |
| + FILE_PATH_LITERAL("navigation_list_model_unittest.html"))); |
| +} |