Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(576)

Side by Side Diff: chrome/browser/ui/tests/browser_uitest.cc

Issue 6001010: Move platform_thread to base/threading and put in the base namespace. I left ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_test.cc ('k') | chrome/common/chrome_plugin_lib.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/base_paths.h" 5 #include "base/base_paths.h"
6 #include "base/file_path.h" 6 #include "base/file_path.h"
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/sys_info.h" 10 #include "base/sys_info.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 // Use JavaScript URL to almost fork a new tab, but not quite. (Leave the 159 // Use JavaScript URL to almost fork a new tab, but not quite. (Leave the
160 // opener non-null.) Should not fork a process. 160 // opener non-null.) Should not fork a process.
161 std::string url_str = "javascript:(function(){w=window.open(); "; 161 std::string url_str = "javascript:(function(){w=window.open(); ";
162 url_str += "w.document.location=\""; 162 url_str += "w.document.location=\"";
163 url_str += test_server.GetURL("").spec(); 163 url_str += test_server.GetURL("").spec();
164 url_str += "\";})()"; 164 url_str += "\";})()";
165 GURL dont_fork_url(url_str); 165 GURL dont_fork_url(url_str);
166 166
167 // Make sure that a new tab but not new process has been created. 167 // Make sure that a new tab but not new process has been created.
168 ASSERT_TRUE(tab->NavigateToURLAsync(dont_fork_url)); 168 ASSERT_TRUE(tab->NavigateToURLAsync(dont_fork_url));
169 PlatformThread::Sleep(sleep_timeout_ms()); 169 base::PlatformThread::Sleep(sleep_timeout_ms());
170 ASSERT_EQ(orig_process_count, GetBrowserProcessCount()); 170 ASSERT_EQ(orig_process_count, GetBrowserProcessCount());
171 int new_tab_count = -1; 171 int new_tab_count = -1;
172 ASSERT_TRUE(window->GetTabCount(&new_tab_count)); 172 ASSERT_TRUE(window->GetTabCount(&new_tab_count));
173 ASSERT_EQ(orig_tab_count + 1, new_tab_count); 173 ASSERT_EQ(orig_tab_count + 1, new_tab_count);
174 174
175 // Same thing if the current tab tries to redirect itself. 175 // Same thing if the current tab tries to redirect itself.
176 url_str = "javascript:(function(){w=window.open(); "; 176 url_str = "javascript:(function(){w=window.open(); ";
177 url_str += "document.location=\""; 177 url_str += "document.location=\"";
178 url_str += test_server.GetURL("").spec(); 178 url_str += test_server.GetURL("").spec();
179 url_str += "\";})()"; 179 url_str += "\";})()";
180 GURL dont_fork_url2(url_str); 180 GURL dont_fork_url2(url_str);
181 181
182 // Make sure that no new process has been created. 182 // Make sure that no new process has been created.
183 ASSERT_TRUE(tab->NavigateToURLAsync(dont_fork_url2)); 183 ASSERT_TRUE(tab->NavigateToURLAsync(dont_fork_url2));
184 PlatformThread::Sleep(sleep_timeout_ms()); 184 base::PlatformThread::Sleep(sleep_timeout_ms());
185 ASSERT_EQ(orig_process_count, GetBrowserProcessCount()); 185 ASSERT_EQ(orig_process_count, GetBrowserProcessCount());
186 } 186 }
187 187
188 TEST_F(VisibleBrowserTest, WindowOpenClose) { 188 TEST_F(VisibleBrowserTest, WindowOpenClose) {
189 FilePath test_file(test_data_directory_); 189 FilePath test_file(test_data_directory_);
190 test_file = test_file.AppendASCII("window.close.html"); 190 test_file = test_file.AppendASCII("window.close.html");
191 191
192 NavigateToURLBlockUntilNavigationsComplete( 192 NavigateToURLBlockUntilNavigationsComplete(
193 net::FilePathToFileURL(test_file), 2); 193 net::FilePathToFileURL(test_file), 2);
194 EXPECT_EQ(L"Title Of Awesomeness", GetActiveTabTitle()); 194 EXPECT_EQ(L"Title Of Awesomeness", GetActiveTabTitle());
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 EXPECT_EQ(0, window_count); 376 EXPECT_EQ(0, window_count);
377 377
378 // Starting a browser window should work just fine. 378 // Starting a browser window should work just fine.
379 ASSERT_TRUE(IsBrowserRunning()); 379 ASSERT_TRUE(IsBrowserRunning());
380 ASSERT_TRUE(automation()->OpenNewBrowserWindow(Browser::TYPE_NORMAL, true)); 380 ASSERT_TRUE(automation()->OpenNewBrowserWindow(Browser::TYPE_NORMAL, true));
381 ASSERT_TRUE(automation()->GetBrowserWindowCount(&window_count)); 381 ASSERT_TRUE(automation()->GetBrowserWindowCount(&window_count));
382 EXPECT_EQ(1, window_count); 382 EXPECT_EQ(1, window_count);
383 } 383 }
384 384
385 } // namespace 385 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_test.cc ('k') | chrome/common/chrome_plugin_lib.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698