OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
7 #include "base/scoped_temp_dir.h" | 7 #include "base/scoped_temp_dir.h" |
8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
9 #include "chrome/browser/ui/browser_tabstrip.h" | 9 #include "chrome/browser/ui/browser_tabstrip.h" |
10 #include "chrome/test/base/in_process_browser_test.h" | 10 #include "chrome/test/base/in_process_browser_test.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 ui_test_utils::NavigateToURL(browser(), | 57 ui_test_utils::NavigateToURL(browser(), |
58 test_server()->GetURL("files/google/google.html")); | 58 test_server()->GetURL("files/google/google.html")); |
59 | 59 |
60 WebContents* web_contents = chrome::GetActiveWebContents(browser()); | 60 WebContents* web_contents = chrome::GetActiveWebContents(browser()); |
61 web_contents->GenerateMHTML(path, | 61 web_contents->GenerateMHTML(path, |
62 base::Bind(&MHTMLGenerationTest::MHTMLGenerated, | 62 base::Bind(&MHTMLGenerationTest::MHTMLGenerated, |
63 this)); | 63 this)); |
64 | 64 |
65 // Block until the MHTML is generated. | 65 // Block until the MHTML is generated. |
66 ui_test_utils::RunMessageLoop(); | 66 content::RunMessageLoop(); |
67 | 67 |
68 EXPECT_TRUE(mhtml_generated()); | 68 EXPECT_TRUE(mhtml_generated()); |
69 EXPECT_GT(file_size(), 0); | 69 EXPECT_GT(file_size(), 0); |
70 | 70 |
71 // Make sure the actual generated file has some contents. | 71 // Make sure the actual generated file has some contents. |
72 int64 file_size; | 72 int64 file_size; |
73 ASSERT_TRUE(file_util::GetFileSize(path, &file_size)); | 73 ASSERT_TRUE(file_util::GetFileSize(path, &file_size)); |
74 EXPECT_GT(file_size, 100); | 74 EXPECT_GT(file_size, 100); |
75 } | 75 } |
76 | 76 |
77 } // namespace | 77 } // namespace |
OLD | NEW |