| 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/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/utf_string_conversions.h" | 6 #include "base/utf_string_conversions.h" |
| 7 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
| 8 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 8 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 9 #include "chrome/test/base/in_process_browser_test.h" | 9 #include "chrome/test/base/in_process_browser_test.h" |
| 10 #include "chrome/test/base/ui_test_utils.h" | 10 #include "chrome/test/base/ui_test_utils.h" |
| 11 #include "content/public/browser/web_contents.h" | 11 #include "content/public/browser/web_contents.h" |
| 12 #include "content/public/browser/web_contents_observer.h" | 12 #include "content/public/browser/web_contents_observer.h" |
| 13 #include "content/public/common/frame_navigate_params.h" | 13 #include "content/public/common/frame_navigate_params.h" |
| 14 #include "net/test/spawned_test_server.h" | 14 #include "net/test/spawned_test_server/spawned_test_server.h" |
| 15 | 15 |
| 16 class MultipartResponseTest : public InProcessBrowserTest, | 16 class MultipartResponseTest : public InProcessBrowserTest, |
| 17 public content::WebContentsObserver { | 17 public content::WebContentsObserver { |
| 18 public: | 18 public: |
| 19 MultipartResponseTest() : did_navigate_any_frame_count_(0), | 19 MultipartResponseTest() : did_navigate_any_frame_count_(0), |
| 20 update_history_count_(0) {} | 20 update_history_count_(0) {} |
| 21 | 21 |
| 22 virtual void DidNavigateAnyFrame( | 22 virtual void DidNavigateAnyFrame( |
| 23 const content::LoadCommittedDetails& details, | 23 const content::LoadCommittedDetails& details, |
| 24 const content::FrameNavigateParams& params) OVERRIDE { | 24 const content::FrameNavigateParams& params) OVERRIDE { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 38 ASSERT_TRUE(test_server()->Start()); | 38 ASSERT_TRUE(test_server()->Start()); |
| 39 | 39 |
| 40 Observe(browser()->tab_strip_model()->GetActiveWebContents()); | 40 Observe(browser()->tab_strip_model()->GetActiveWebContents()); |
| 41 ui_test_utils::NavigateToURL(browser(), test_server()->GetURL("multipart")); | 41 ui_test_utils::NavigateToURL(browser(), test_server()->GetURL("multipart")); |
| 42 | 42 |
| 43 EXPECT_EQ(ASCIIToUTF16("page 9"), | 43 EXPECT_EQ(ASCIIToUTF16("page 9"), |
| 44 browser()->tab_strip_model()->GetActiveWebContents()->GetTitle()); | 44 browser()->tab_strip_model()->GetActiveWebContents()->GetTitle()); |
| 45 EXPECT_EQ(1, update_history_count_); | 45 EXPECT_EQ(1, update_history_count_); |
| 46 EXPECT_GT(did_navigate_any_frame_count_, update_history_count_); | 46 EXPECT_GT(did_navigate_any_frame_count_, update_history_count_); |
| 47 } | 47 } |
| OLD | NEW |