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

Side by Side Diff: chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc

Issue 2371113003: Do not give instant focus if a view's toplevelwidget is not active (Closed)
Patch Set: new patch Created 4 years, 2 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
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 // Disable everything on windows only. http://crbug.com/306144 5 // Disable everything on windows only. http://crbug.com/306144
6 #ifndef OS_WIN 6 #ifndef OS_WIN
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 17 matching lines...) Expand all
28 #include "chrome/browser/extensions/browser_action_test_util.h" 28 #include "chrome/browser/extensions/browser_action_test_util.h"
29 #include "chrome/browser/extensions/extension_apitest.h" 29 #include "chrome/browser/extensions/extension_apitest.h"
30 #include "chrome/browser/extensions/extension_function_test_utils.h" 30 #include "chrome/browser/extensions/extension_function_test_utils.h"
31 #include "chrome/browser/net/url_request_mock_util.h" 31 #include "chrome/browser/net/url_request_mock_util.h"
32 #include "chrome/browser/profiles/profile.h" 32 #include "chrome/browser/profiles/profile.h"
33 #include "chrome/browser/ui/browser.h" 33 #include "chrome/browser/ui/browser.h"
34 #include "chrome/browser/ui/browser_tabstrip.h" 34 #include "chrome/browser/ui/browser_tabstrip.h"
35 #include "chrome/common/extensions/api/downloads.h" 35 #include "chrome/common/extensions/api/downloads.h"
36 #include "chrome/common/pref_names.h" 36 #include "chrome/common/pref_names.h"
37 #include "chrome/test/base/in_process_browser_test.h" 37 #include "chrome/test/base/in_process_browser_test.h"
38 #include "chrome/test/base/interactive_test_utils.h"
38 #include "chrome/test/base/ui_test_utils.h" 39 #include "chrome/test/base/ui_test_utils.h"
39 #include "components/prefs/pref_service.h" 40 #include "components/prefs/pref_service.h"
40 #include "content/public/browser/browser_context.h" 41 #include "content/public/browser/browser_context.h"
41 #include "content/public/browser/browser_thread.h" 42 #include "content/public/browser/browser_thread.h"
42 #include "content/public/browser/download_item.h" 43 #include "content/public/browser/download_item.h"
43 #include "content/public/browser/download_manager.h" 44 #include "content/public/browser/download_manager.h"
44 #include "content/public/browser/notification_service.h" 45 #include "content/public/browser/notification_service.h"
45 #include "content/public/browser/storage_partition.h" 46 #include "content/public/browser/storage_partition.h"
46 #include "content/public/browser/web_contents.h" 47 #include "content/public/browser/web_contents.h"
47 #include "content/public/common/content_features.h" 48 #include "content/public/common/content_features.h"
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 std::unique_ptr<content::DownloadTestObserver> observer( 466 std::unique_ptr<content::DownloadTestObserver> observer(
466 CreateInProgressDownloadObserver(1)); 467 CreateInProgressDownloadObserver(1));
467 GURL slow_download_url(net::URLRequestSlowDownloadJob::kUnknownSizeUrl); 468 GURL slow_download_url(net::URLRequestSlowDownloadJob::kUnknownSizeUrl);
468 DownloadManager* manager = GetCurrentManager(); 469 DownloadManager* manager = GetCurrentManager();
469 470
470 EXPECT_EQ(0, manager->NonMaliciousInProgressCount()); 471 EXPECT_EQ(0, manager->NonMaliciousInProgressCount());
471 EXPECT_EQ(0, manager->InProgressCount()); 472 EXPECT_EQ(0, manager->InProgressCount());
472 if (manager->InProgressCount() != 0) 473 if (manager->InProgressCount() != 0)
473 return NULL; 474 return NULL;
474 475
476 EXPECT_TRUE(ui_test_utils::BringBrowserWindowToFront(current_browser()));
sky 2016/09/28 21:56:53 Why is this necessary? In process browser tests al
Qiang(Joe) Xu 2016/09/29 00:07:25 These two browser_tests are both related to more t
475 ui_test_utils::NavigateToURL(current_browser(), slow_download_url); 477 ui_test_utils::NavigateToURL(current_browser(), slow_download_url);
476 478
477 observer->WaitForFinished(); 479 observer->WaitForFinished();
478 EXPECT_EQ(1u, observer->NumDownloadsSeenInState(DownloadItem::IN_PROGRESS)); 480 EXPECT_EQ(1u, observer->NumDownloadsSeenInState(DownloadItem::IN_PROGRESS));
479 481
480 DownloadManager::DownloadVector items; 482 DownloadManager::DownloadVector items;
481 manager->GetAllDownloads(&items); 483 manager->GetAllDownloads(&items);
482 484
483 DownloadItem* new_item = NULL; 485 DownloadItem* new_item = NULL;
484 for (DownloadManager::DownloadVector::iterator iter = items.begin(); 486 for (DownloadManager::DownloadVector::iterator iter = items.begin();
(...skipping 3821 matching lines...) Expand 10 before | Expand all | Expand 10 after
4306 EXPECT_EQ(downloads::FILENAME_CONFLICT_ACTION_PROMPT, conflict_action); 4308 EXPECT_EQ(downloads::FILENAME_CONFLICT_ACTION_PROMPT, conflict_action);
4307 EXPECT_FALSE(warnings.empty()); 4309 EXPECT_FALSE(warnings.empty());
4308 EXPECT_EQ(Warning::kDownloadFilenameConflict, 4310 EXPECT_EQ(Warning::kDownloadFilenameConflict,
4309 warnings.begin()->warning_type()); 4311 warnings.begin()->warning_type());
4310 EXPECT_EQ("incumbent", warnings.begin()->extension_id()); 4312 EXPECT_EQ("incumbent", warnings.begin()->extension_id());
4311 } 4313 }
4312 4314
4313 } // namespace extensions 4315 } // namespace extensions
4314 4316
4315 #endif // http://crbug.com/306144 4317 #endif // http://crbug.com/306144
OLDNEW
« no previous file with comments | « ash/common/system/tray/tray_details_view_unittest.cc ('k') | chrome/browser/geolocation/geolocation_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698