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

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

Issue 183853011: Move TrimWhitespace to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 <sstream> 5 #include <sstream>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 1932 matching lines...) Expand 10 before | Expand all | Expand 10 after
1943 CreatedObserver created_observer(manager); 1943 CreatedObserver created_observer(manager);
1944 created_observer.Wait(); 1944 created_observer.Wait();
1945 manager->GetAllDownloads(&downloads); 1945 manager->GetAllDownloads(&downloads);
1946 ASSERT_EQ(1UL, downloads.size()); 1946 ASSERT_EQ(1UL, downloads.size());
1947 DownloadItem* item = downloads[0]; 1947 DownloadItem* item = downloads[0];
1948 EXPECT_EQ(file.value(), item->GetFullPath().BaseName().value()); 1948 EXPECT_EQ(file.value(), item->GetFullPath().BaseName().value());
1949 EXPECT_EQ(file.value(), item->GetTargetFilePath().BaseName().value()); 1949 EXPECT_EQ(file.value(), item->GetTargetFilePath().BaseName().value());
1950 EXPECT_EQ(download_url, item->GetURL()); 1950 EXPECT_EQ(download_url, item->GetURL());
1951 // The following are set by download-test1.lib.mock-http-headers. 1951 // The following are set by download-test1.lib.mock-http-headers.
1952 std::string etag = item->GetETag(); 1952 std::string etag = item->GetETag();
1953 TrimWhitespaceASCII(etag, TRIM_ALL, &etag); 1953 base::TrimWhitespaceASCII(etag, base::TRIM_ALL, &etag);
1954 EXPECT_EQ("abracadabra", etag); 1954 EXPECT_EQ("abracadabra", etag);
1955 1955
1956 std::string last_modified = item->GetLastModifiedTime(); 1956 std::string last_modified = item->GetLastModifiedTime();
1957 TrimWhitespaceASCII(last_modified, TRIM_ALL, &last_modified); 1957 base::TrimWhitespaceASCII(last_modified, base::TRIM_ALL, &last_modified);
1958 EXPECT_EQ("Mon, 13 Nov 2006 20:31:09 GMT", last_modified); 1958 EXPECT_EQ("Mon, 13 Nov 2006 20:31:09 GMT", last_modified);
1959 } 1959 }
1960 1960
1961 // Test for crbug.com/14505. This tests that chrome:// urls are still functional 1961 // Test for crbug.com/14505. This tests that chrome:// urls are still functional
1962 // after download of a file while viewing another chrome://. 1962 // after download of a file while viewing another chrome://.
1963 IN_PROC_BROWSER_TEST_F(DownloadTest, ChromeURLAfterDownload) { 1963 IN_PROC_BROWSER_TEST_F(DownloadTest, ChromeURLAfterDownload) {
1964 base::FilePath file(FILE_PATH_LITERAL("download-test1.lib")); 1964 base::FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
1965 GURL download_url(URLRequestMockHTTPJob::GetMockUrl(file)); 1965 GURL download_url(URLRequestMockHTTPJob::GetMockUrl(file));
1966 GURL flags_url(chrome::kChromeUIFlagsURL); 1966 GURL flags_url(chrome::kChromeUIFlagsURL);
1967 GURL extensions_url(chrome::kChromeUIExtensionsFrameURL); 1967 GURL extensions_url(chrome::kChromeUIExtensionsFrameURL);
(...skipping 1275 matching lines...) Expand 10 before | Expand all | Expand 10 after
3243 3243
3244 // No errors this time. The download should complete successfully. 3244 // No errors this time. The download should complete successfully.
3245 EXPECT_FALSE(completion_observer->IsFinished()); 3245 EXPECT_FALSE(completion_observer->IsFinished());
3246 completion_observer->StartObserving(); 3246 completion_observer->StartObserving();
3247 download->Resume(); 3247 download->Resume();
3248 completion_observer->WaitForFinished(); 3248 completion_observer->WaitForFinished();
3249 EXPECT_EQ(DownloadItem::COMPLETE, download->GetState()); 3249 EXPECT_EQ(DownloadItem::COMPLETE, download->GetState());
3250 3250
3251 EXPECT_FALSE(DidShowFileChooser()); 3251 EXPECT_FALSE(DidShowFileChooser());
3252 } 3252 }
OLDNEW
« no previous file with comments | « chrome/browser/devtools/adb_client_socket.cc ('k') | chrome/browser/extensions/user_script_master.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698