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

Side by Side Diff: chrome/browser/download/save_page_browsertest.cc

Issue 7327007: Moving notification types which are chrome specific to a new header file chrome_notification_type... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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/download/save_package.cc ('k') | chrome/browser/enumerate_modules_model_win.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_path.h" 5 #include "base/file_path.h"
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/scoped_temp_dir.h" 8 #include "base/scoped_temp_dir.h"
9 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #include "chrome/browser/download/download_item.h" 10 #include "chrome/browser/download/download_item.h"
11 #include "chrome/browser/ui/browser.h" 11 #include "chrome/browser/ui/browser.h"
12 #include "chrome/browser/ui/browser_window.h" 12 #include "chrome/browser/ui/browser_window.h"
13 #include "chrome/browser/ui/download/download_tab_helper.h" 13 #include "chrome/browser/ui/download/download_tab_helper.h"
14 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 14 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
15 #include "chrome/browser/ui/webui/active_downloads_ui.h" 15 #include "chrome/browser/ui/webui/active_downloads_ui.h"
16 #include "chrome/common/chrome_notification_types.h"
16 #include "chrome/common/chrome_paths.h" 17 #include "chrome/common/chrome_paths.h"
17 #include "chrome/common/url_constants.h" 18 #include "chrome/common/url_constants.h"
18 #include "chrome/test/in_process_browser_test.h" 19 #include "chrome/test/in_process_browser_test.h"
19 #include "chrome/test/ui_test_utils.h" 20 #include "chrome/test/ui_test_utils.h"
20 #include "content/browser/net/url_request_mock_http_job.h" 21 #include "content/browser/net/url_request_mock_http_job.h"
21 #include "content/browser/tab_contents/tab_contents.h" 22 #include "content/browser/tab_contents/tab_contents.h"
22 #include "content/common/notification_service.h" 23 #include "content/common/notification_service.h"
23 #include "testing/gtest/include/gtest/gtest.h" 24 #include "testing/gtest/include/gtest/gtest.h"
24 25
25 namespace { 26 namespace {
(...skipping 11 matching lines...) Expand all
37 protected: 38 protected:
38 void SetUp() { 39 void SetUp() {
39 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_dir_)); 40 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_dir_));
40 ASSERT_TRUE(save_dir_.CreateUniqueTempDir()); 41 ASSERT_TRUE(save_dir_.CreateUniqueTempDir());
41 InProcessBrowserTest::SetUp(); 42 InProcessBrowserTest::SetUp();
42 } 43 }
43 44
44 GURL WaitForSavePackageToFinish() { 45 GURL WaitForSavePackageToFinish() {
45 ui_test_utils::TestNotificationObserver observer; 46 ui_test_utils::TestNotificationObserver observer;
46 ui_test_utils::RegisterAndWait(&observer, 47 ui_test_utils::RegisterAndWait(&observer,
47 NotificationType::SAVE_PACKAGE_SUCCESSFULLY_FINISHED, 48 chrome::NOTIFICATION_SAVE_PACKAGE_SUCCESSFULLY_FINISHED,
48 NotificationService::AllSources()); 49 NotificationService::AllSources());
49 return *Details<GURL>(observer.details()).ptr(); 50 return *Details<GURL>(observer.details()).ptr();
50 } 51 }
51 52
52 void CheckDownloadUI(const FilePath& download_path) { 53 void CheckDownloadUI(const FilePath& download_path) {
53 #if defined(OS_CHROMEOS) 54 #if defined(OS_CHROMEOS)
54 Browser* popup = ActiveDownloadsUI::GetPopup(); 55 Browser* popup = ActiveDownloadsUI::GetPopup();
55 EXPECT_TRUE(popup); 56 EXPECT_TRUE(popup);
56 ActiveDownloadsUI* downloads_ui = static_cast<ActiveDownloadsUI*>( 57 ActiveDownloadsUI* downloads_ui = static_cast<ActiveDownloadsUI*>(
57 popup->GetSelectedTabContents()->web_ui()); 58 popup->GetSelectedTabContents()->web_ui());
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 full_file_name)); 200 full_file_name));
200 EXPECT_TRUE(file_util::ContentsEqual( 201 EXPECT_TRUE(file_util::ContentsEqual(
201 test_dir_.Append(FilePath(kTestDir)).AppendASCII("1.png"), 202 test_dir_.Append(FilePath(kTestDir)).AppendASCII("1.png"),
202 dir.AppendASCII("1.png"))); 203 dir.AppendASCII("1.png")));
203 EXPECT_TRUE(file_util::ContentsEqual( 204 EXPECT_TRUE(file_util::ContentsEqual(
204 test_dir_.Append(FilePath(kTestDir)).AppendASCII("1.css"), 205 test_dir_.Append(FilePath(kTestDir)).AppendASCII("1.css"),
205 dir.AppendASCII("1.css"))); 206 dir.AppendASCII("1.css")));
206 } 207 }
207 208
208 } // namespace 209 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/download/save_package.cc ('k') | chrome/browser/enumerate_modules_model_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698