summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sessions
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 /chrome/browser/sessions
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
Diffstat (limited to 'chrome/browser/sessions')
-rw-r--r--chrome/browser/sessions/session_backend.cc12
1 files changed, 7 insertions, 5 deletions
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;