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

Side by Side Diff: chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc

Issue 273233004: Fix some more tests that were writing to the user's home directory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
OLDNEW
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 <list> 5 #include <list>
6 #include <set> 6 #include <set>
7 7
8 #include "base/files/scoped_temp_dir.h"
8 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
9 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
10 #include "base/strings/string_util.h" 11 #include "base/strings/string_util.h"
11 #include "base/strings/stringprintf.h" 12 #include "base/strings/stringprintf.h"
12 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
13 #include "chrome/app/chrome_command_ids.h" 14 #include "chrome/app/chrome_command_ids.h"
14 #include "chrome/browser/browser_process.h" 15 #include "chrome/browser/browser_process.h"
15 #include "chrome/browser/chrome_browser_main.h" 16 #include "chrome/browser/chrome_browser_main.h"
16 #include "chrome/browser/chrome_browser_main_extra_parts.h" 17 #include "chrome/browser/chrome_browser_main_extra_parts.h"
17 #include "chrome/browser/chrome_content_browser_client.h" 18 #include "chrome/browser/chrome_content_browser_client.h"
18 #include "chrome/browser/chrome_notification_types.h" 19 #include "chrome/browser/chrome_notification_types.h"
19 #include "chrome/browser/download/download_browsertest.h" 20 #include "chrome/browser/download/download_browsertest.h"
21 #include "chrome/browser/download/download_prefs.h"
20 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" 22 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h"
21 #include "chrome/browser/extensions/extension_apitest.h" 23 #include "chrome/browser/extensions/extension_apitest.h"
22 #include "chrome/browser/extensions/extension_service.h" 24 #include "chrome/browser/extensions/extension_service.h"
23 #include "chrome/browser/profiles/profile.h" 25 #include "chrome/browser/profiles/profile.h"
24 #include "chrome/browser/renderer_context_menu/render_view_context_menu_test_uti l.h" 26 #include "chrome/browser/renderer_context_menu/render_view_context_menu_test_uti l.h"
25 #include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate. h" 27 #include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate. h"
26 #include "chrome/browser/ui/browser.h" 28 #include "chrome/browser/ui/browser.h"
27 #include "chrome/browser/ui/tabs/tab_strip_model.h" 29 #include "chrome/browser/ui/tabs/tab_strip_model.h"
28 #include "chrome/test/base/ui_test_utils.h" 30 #include "chrome/test/base/ui_test_utils.h"
29 #include "content/public/browser/browser_thread.h" 31 #include "content/public/browser/browser_thread.h"
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 << message_; 316 << message_;
315 } 317 }
316 318
317 IN_PROC_BROWSER_TEST_F(WebNavigationApiTest, ServerRedirect) { 319 IN_PROC_BROWSER_TEST_F(WebNavigationApiTest, ServerRedirect) {
318 ASSERT_TRUE(StartEmbeddedTestServer()); 320 ASSERT_TRUE(StartEmbeddedTestServer());
319 ASSERT_TRUE(RunExtensionTest("webnavigation/serverRedirect")) 321 ASSERT_TRUE(RunExtensionTest("webnavigation/serverRedirect"))
320 << message_; 322 << message_;
321 } 323 }
322 324
323 IN_PROC_BROWSER_TEST_F(WebNavigationApiTest, Download) { 325 IN_PROC_BROWSER_TEST_F(WebNavigationApiTest, Download) {
326 base::ScopedTempDir download_directory;
327 ASSERT_TRUE(download_directory.CreateUniqueTempDir());
328 DownloadPrefs* download_prefs =
329 DownloadPrefs::FromBrowserContext(browser()->profile());
330 download_prefs->SetDownloadPath(download_directory.path());
331
324 DownloadTestObserverNotInProgress download_observer( 332 DownloadTestObserverNotInProgress download_observer(
325 content::BrowserContext::GetDownloadManager(profile()), 1); 333 content::BrowserContext::GetDownloadManager(profile()), 1);
326 download_observer.StartObserving(); 334 download_observer.StartObserving();
327 ASSERT_TRUE(StartEmbeddedTestServer()); 335 ASSERT_TRUE(StartEmbeddedTestServer());
328 ASSERT_TRUE(RunExtensionTest("webnavigation/download")) 336 ASSERT_TRUE(RunExtensionTest("webnavigation/download"))
329 << message_; 337 << message_;
330 download_observer.WaitForFinished(); 338 download_observer.WaitForFinished();
331 } 339 }
332 340
333 IN_PROC_BROWSER_TEST_F(WebNavigationApiTest, ServerRedirectSingleProcess) { 341 IN_PROC_BROWSER_TEST_F(WebNavigationApiTest, ServerRedirectSingleProcess) {
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 "extensions/api_test/webnavigation/crash/b.html", 636 "extensions/api_test/webnavigation/crash/b.html",
629 embedded_test_server()->port())); 637 embedded_test_server()->port()));
630 ui_test_utils::NavigateToURL(browser(), url); 638 ui_test_utils::NavigateToURL(browser(), url);
631 639
632 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); 640 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message();
633 } 641 }
634 642
635 #endif 643 #endif
636 644
637 } // namespace extensions 645 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/policy/policy_browsertest.cc » ('j') | chrome/browser/prefs/pref_functional_browsertest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698