| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/chrome_content_browser_client.h" | 9 #include "chrome/browser/chrome_content_browser_client.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1291 active_contents()->GetBrowserContext(), nullptr)); | 1291 active_contents()->GetBrowserContext(), nullptr)); |
| 1292 browser()->tab_strip_model()->InsertWebContentsAt(1, new_contents, | 1292 browser()->tab_strip_model()->InsertWebContentsAt(1, new_contents, |
| 1293 TabStripModel::ADD_ACTIVE); | 1293 TabStripModel::ADD_ACTIVE); |
| 1294 EXPECT_EQ(active_contents(), new_contents); | 1294 EXPECT_EQ(active_contents(), new_contents); |
| 1295 | 1295 |
| 1296 // Starting the test body. | 1296 // Starting the test body. |
| 1297 CreateIframePage("a(b)"); | 1297 CreateIframePage("a(b)"); |
| 1298 std::vector<content::RenderFrameHost*> frames{GetFrame(IndexVector{}), | 1298 std::vector<content::RenderFrameHost*> frames{GetFrame(IndexVector{}), |
| 1299 GetFrame(IndexVector{0})}; | 1299 GetFrame(IndexVector{0})}; |
| 1300 std::vector<content::RenderWidgetHostView*> views; | 1300 std::vector<content::RenderWidgetHostView*> views; |
| 1301 for (auto frame : frames) | 1301 for (auto* frame : frames) |
| 1302 views.push_back(frame->GetView()); | 1302 views.push_back(frame->GetView()); |
| 1303 std::vector<std::string> values{"main frame", "child frame"}; | 1303 std::vector<std::string> values{"main frame", "child frame"}; |
| 1304 | 1304 |
| 1305 // Adding some field with text to each frame so that we can later query for | 1305 // Adding some field with text to each frame so that we can later query for |
| 1306 // dictionary lookup. | 1306 // dictionary lookup. |
| 1307 for (size_t i = 0; i < frames.size(); ++i) | 1307 for (size_t i = 0; i < frames.size(); ++i) |
| 1308 AddInputFieldToFrame(frames[i], "text", values[i], true); | 1308 AddInputFieldToFrame(frames[i], "text", values[i], true); |
| 1309 | 1309 |
| 1310 std::string result; | 1310 std::string result; |
| 1311 // Recording window count now so that our WindowCountObserver will detect the | 1311 // Recording window count now so that our WindowCountObserver will detect the |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1356 | 1356 |
| 1357 // Closing this WebContents while we still hold on to our TestBrowserClient. | 1357 // Closing this WebContents while we still hold on to our TestBrowserClient. |
| 1358 EXPECT_TRUE(browser()->tab_strip_model()->CloseWebContentsAt( | 1358 EXPECT_TRUE(browser()->tab_strip_model()->CloseWebContentsAt( |
| 1359 1, TabStripModel::CLOSE_USER_GESTURE)); | 1359 1, TabStripModel::CLOSE_USER_GESTURE)); |
| 1360 | 1360 |
| 1361 // For the cleanup of the original WebContents in tab index 0. | 1361 // For the cleanup of the original WebContents in tab index 0. |
| 1362 content::SetBrowserClientForTesting(old_browser_client); | 1362 content::SetBrowserClientForTesting(old_browser_client); |
| 1363 } | 1363 } |
| 1364 #endif // defined(MAC_OSX) | 1364 #endif // defined(MAC_OSX) |
| 1365 #endif // !defined(OS_ANDROID) | 1365 #endif // !defined(OS_ANDROID) |
| OLD | NEW |