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

Issue 10700024: Revert 144807 - Rewrite DownloadsApiTest in C++. (Closed)

Created:
8 years, 5 months ago by dmichael (off chromium)
Modified:
8 years, 5 months ago
Reviewers:
benjhayden
CC:
chromium-reviews, Aaron Boodman, mihaip-chromium-reviews_chromium.org, rdsmith+dwatch_chromium.org
Visibility:
Public.

Description

Revert 144807 - Rewrite DownloadsApiTest in C++. Caused a compile error on Linux ChromiumOS Clang: chrome/browser/extensions/api/downloads/downloads_api_unittest.cc:1581:44: error: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Werror,-Wformat] " \"filename\": \"unsafe-header-%lu.txt\"," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~ ./testing/gtest/include/gtest/gtest.h:1924:70: note: expanded from macro 'EXPECT_STREQ' EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual) ^ testing/gtest/include/gtest/gtest_pred_impl.h:162:40: note: expanded from macro 'EXPECT_PRED_FORMAT2' GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_) ^ testing/gtest/include/gtest/gtest_pred_impl.h:147:43: note: expanded from macro 'GTEST_PRED_FORMAT2_' GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2), \ ^ testing/gtest/include/gtest/gtest_pred_impl.h:77:52: note: expanded from macro 'GTEST_ASSERT_' if (const ::testing::AssertionResult gtest_ar = (expression)) \ ^~~~~~~~~~ This uses much less magic than the javascript version, so it's more robust and easier to debug and fix. Aaron is the primary reviewer since most of this is extensions-specific. Randy, none of this is particularly downloads-specific. You're welcome to review or mute. ExtensionDownloadsEventRouter sends a chrome::NOTIFICATION_EXTENSION_DOWNLOADS_EVENT notification whenever it fires an event. DownloadsEventsListener is-a content::NotificationObserver that listens for chrome::NOTIFICATION_EXTENSION_DOWNLOADS_EVENT and logs them. DEL facilitates waiting for specific events by running the message loops, optionally with a timeout to prevent hitting the 45s hard timeout. If a WaitFor() call times out, then it prints the events that it was waiting for along with the events that it received to aid debugging. BrowserContext::GetFileSystemContext() is used to create HTML5 FileSystem Files. Empty extensions are used because DownloadsDownloadFunction relies on its host permissions mechanisms. I considered grouping all of the new TEST_Fs in a single large TEST_F in order to amortize start-up cost, but that would have required a comment explaining how to disable sub-sections, and it would have complicated time-outs. Besides, most bots can parallelize. Review URL: https://chromiumcodereview.appspot.com/10542038 TBR=benjhayden@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=144813

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+83 lines, -1296 lines) Patch
M chrome/browser/download/chrome_download_manager_delegate.cc View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/extensions/api/downloads/downloads_api.h View 4 chunks +3 lines, -9 lines 0 comments Download
MM chrome/browser/extensions/api/downloads/downloads_api.cc View 6 chunks +23 lines, -20 lines 0 comments Download
M chrome/browser/extensions/api/downloads/downloads_api_unittest.cc View 29 chunks +58 lines, -1248 lines 0 comments Download
A + chrome/browser/extensions/api/downloads/downloads_apitest.cc View 0 chunks +-1 lines, --1 lines 0 comments Download
MM chrome/chrome_tests.gypi View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/chrome_notification_types.h View 1 chunk +0 lines, -5 lines 0 comments Download
A + chrome/test/data/extensions/api_test/downloads/manifest.json View 0 chunks +-1 lines, --1 lines 0 comments Download
A + chrome/test/data/extensions/api_test/downloads/test.js View 0 chunks +-1 lines, --1 lines 0 comments Download
D chrome/test/data/extensions/api_test/downloads_split/empty.html View 1 chunk +0 lines, -4 lines 0 comments Download
D chrome/test/data/extensions/api_test/downloads_split/manifest.json View 1 chunk +0 lines, -11 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
dmichael (off chromium)
8 years, 5 months ago (2012-06-28 22:06:24 UTC) #1
benjhayden
8 years, 5 months ago (2012-06-29 14:28:44 UTC) #2
lgtm

Powered by Google App Engine
This is Rietveld 408576698