OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2013 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 <vector> | |
6 | |
7 #include "chrome/browser/ui/browser.h" | |
8 #include "chrome/browser/ui/tabs/tab_strip_model.h" | |
9 #include "chrome/test/base/in_process_browser_test.h" | |
10 #include "chrome/test/base/ui_test_utils.h" | |
11 #include "content/public/browser/render_view_host.h" | |
12 #include "content/public/browser/web_contents.h" | |
13 #include "content/public/test/browser_test_utils.h" | |
14 #include "grit/webui_resources.h" | |
15 | |
16 class FileManagerUnitTestsBrowserTest : public InProcessBrowserTest { | |
17 public: | |
18 // Runs all test functions in |file|, waiting for them to complete. | |
19 void RunTest(const base::FilePath& file) { | |
20 GURL url = ui_test_utils::GetTestUrl( | |
21 base::FilePath(FILE_PATH_LITERAL("file_manager/unit_tests")), file); | |
22 ui_test_utils::NavigateToURL(browser(), url); | |
23 | |
24 content::RenderViewHost* rvh = browser()->tab_strip_model() | |
25 ->GetActiveWebContents()->GetRenderViewHost(); | |
26 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.
| |
27 | |
28 const std::vector<int> empty_libraries; | |
29 EXPECT_TRUE(ExecuteWebUIResourceTest(rvh, empty_libraries)); | |
30 } | |
31 }; | |
32 | |
33 IN_PROC_BROWSER_TEST_F( | |
34 FileManagerUnitTestsBrowserTest, NavigationListModelTest) { | |
35 RunTest(base::FilePath( | |
36 FILE_PATH_LITERAL("navigation_list_model_unittest.html"))); | |
37 } | |
OLD | NEW |