summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-17 09:35:11 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-17 09:35:11 +0000
commitfc3f1b63a9bfd577600364b89899171a18f84101 (patch)
treebc4867eb49d9cec08a22cdf63a1b920edd66e811
parentc46b0e667387bb42a18be86e8b1f85e968902953 (diff)
downloadchromium_src-fc3f1b63a9bfd577600364b89899171a18f84101.zip
chromium_src-fc3f1b63a9bfd577600364b89899171a18f84101.tar.gz
chromium_src-fc3f1b63a9bfd577600364b89899171a18f84101.tar.bz2
Porting unit tests in chrome/
Enable following tests on Linux: browser/autocomplete/autocomplete_unittest.cc browser/navigation_controller_unittest.cc browser/search_engines/template_url_model_unittest.cc browser/sessions/session_backend_unittest.cc browser/tab_contents/web_contents_unittest.cc Remove not-existing file from remove list for Linux. Check for zero-size write in SessionBackend because it's an error in POSIX (but is ok from the session backend's perspective). Review URL: http://codereview.chromium.org/42223 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11852 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/autocomplete/autocomplete_unittest.cc2
-rw-r--r--chrome/browser/sessions/session_backend.cc12
-rw-r--r--chrome/test/unit/unit_tests.scons7
3 files changed, 8 insertions, 13 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_unittest.cc b/chrome/browser/autocomplete/autocomplete_unittest.cc
index e798adf..e99fabd 100644
--- a/chrome/browser/autocomplete/autocomplete_unittest.cc
+++ b/chrome/browser/autocomplete/autocomplete_unittest.cc
@@ -230,8 +230,8 @@ TEST(AutocompleteTest, InputType) {
{ L"javascript:alert(\"Hey there!\");", AutocompleteInput::URL },
#if defined(OS_WIN)
{ L"C:\\Program Files", AutocompleteInput::URL },
-#endif
{ L"\\\\Server\\Folder\\File", AutocompleteInput::URL },
+#endif // defined(OS_WIN)
{ L"http://foo.com/", AutocompleteInput::URL },
{ L"127.0.0.1", AutocompleteInput::URL },
{ L"browser.tabs.closeButtons", AutocompleteInput::UNKNOWN },
diff --git a/chrome/browser/sessions/session_backend.cc b/chrome/browser/sessions/session_backend.cc
index 13fe522..240d151 100644
--- a/chrome/browser/sessions/session_backend.cc
+++ b/chrome/browser/sessions/session_backend.cc
@@ -306,11 +306,13 @@ bool SessionBackend::AppendCommandsToFile(net::FileStream* file,
NOTREACHED() << "error writing";
return false;
}
- wrote = file->Write(reinterpret_cast<char*>((*i)->contents()),
- content_size, NULL);
- if (wrote != content_size) {
- NOTREACHED() << "error writing";
- return false;
+ if (content_size > 0) {
+ wrote = file->Write(reinterpret_cast<char*>((*i)->contents()),
+ content_size, NULL);
+ if (wrote != content_size) {
+ NOTREACHED() << "error writing";
+ return false;
+ }
}
}
return true;
diff --git a/chrome/test/unit/unit_tests.scons b/chrome/test/unit/unit_tests.scons
index 760e2d1..221479b 100644
--- a/chrome/test/unit/unit_tests.scons
+++ b/chrome/test/unit/unit_tests.scons
@@ -378,7 +378,6 @@ if env.Bit('posix'):
if not env.Bit('windows'):
# TODO(port): Port these.
input_files.Remove(
- '$CHROME_DIR/browser/autocomplete/autocomplete_unittest.cc',
'$CHROME_DIR/browser/bookmarks/bookmark_context_menu_test.cc',
'$CHROME_DIR/browser/bookmarks/bookmark_drag_data_unittest.cc',
'$CHROME_DIR/browser/bookmarks/bookmark_folder_tree_model_unittest.cc',
@@ -393,8 +392,6 @@ if not env.Bit('windows'):
'$CHROME_DIR/browser/importer/firefox_importer_unittest.cc',
'$CHROME_DIR/browser/importer/importer_unittest.cc',
'$CHROME_DIR/browser/login_prompt_unittest.cc',
- '$CHROME_DIR/browser/renderer_host/render_widget_host_unittests.cc',
- '$CHROME_DIR/browser/navigation_controller_unittest.cc',
'$CHROME_DIR/browser/net/resolve_proxy_msg_helper_unittest.cc',
'$CHROME_DIR/browser/password_manager/encryptor_unittest.cc',
'$CHROME_DIR/browser/password_manager/password_form_manager_unittest.cc',
@@ -404,12 +401,8 @@ if not env.Bit('windows'):
'$CHROME_DIR/browser/printing/win_printing_context_unittest.cc',
'$CHROME_DIR/browser/profile_manager_unittest.cc',
'$CHROME_DIR/browser/rlz/rlz_unittest.cc',
- '$CHROME_DIR/browser/search_engines/template_url_model_unittest.cc',
- '$CHROME_DIR/browser/sessions/session_backend_unittest.cc',
- '$CHROME_DIR/browser/sessions/session_service_test_helper.cc',
'$CHROME_DIR/browser/sessions/session_service_unittest.cc',
'$CHROME_DIR/browser/sessions/tab_restore_service_unittest.cc',
- '$CHROME_DIR/browser/tab_contents/web_contents_unittest.cc',
'$CHROME_DIR/browser/tabs/tab_strip_model_unittest.cc',
'$CHROME_DIR/browser/views/bookmark_editor_view_unittest.cc',
'$CHROME_DIR/browser/views/keyword_editor_view_unittest.cc',