Bug 34940 - [Gtk] testwebview does not work when called with absolute path
Summary: [Gtk] testwebview does not work when called with absolute path
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 62935
  Show dependency treegraph
 
Reported: 2010-02-15 06:05 PST by arno.
Modified: 2011-06-19 00:11 PDT (History)
1 user (show)

See Also:


Attachments
patch v1 (1.60 KB, patch)
2010-02-15 06:11 PST, arno.
gustavo: review-
gustavo: commit-queue-
Details | Formatted Diff | Diff
patch v2 (7.03 KB, patch)
2010-02-19 10:31 PST, arno.
no flags Details | Formatted Diff | Diff
patch v2.2 (7.10 KB, patch)
2010-02-19 10:36 PST, arno.
gustavo: review-
gustavo: commit-queue-
Details | Formatted Diff | Diff
patch v2.3 (5.82 KB, patch)
2010-02-22 09:52 PST, arno.
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description arno. 2010-02-15 06:05:28 PST
Hi, when trying to run testwebviow from a random directory (ie: with an absolute path), it fails with following error: 

15:04 127 ~ % ~/webkit/WebKit/WebKitBuild/Release/Programs/unittests/testwebview
**
ERROR:../../WebKit/gtk/tests/testwebview.c:244:main: assertion failed: (!g_str_equal(getcwd(path_name, PATH_MAX), "/"))
zsh: abort      ~/webkit/WebKit/WebKitBuild/Release/Programs/unittests/testwebview

other testes in unittests succeed when run with absolute path.
Comment 1 arno. 2010-02-15 06:11:01 PST
Created attachment 48749 [details]
patch v1
Comment 2 Gustavo Noronha (kov) 2010-02-18 06:06:40 PST
Comment on attachment 48749 [details]
patch v1

That looks good. I'm afraid at least one more test needs this fix, though, and it would be good to have this split to a function in an utils file. Would you mind applying the fix to the other file, and potentially do this refactoring? It's OK if you just apply the fix to the other files, but the refactoring would rock =).

 236     if (g_path_is_absolute (argv[0])) {
 237         g_chdir (g_path_get_dirname (argv[0]));

These spaces before the ( are wrong, r- for this style problem.
Comment 3 arno. 2010-02-19 10:31:03 PST
Created attachment 49090 [details]
patch v2

Here is an updated version.
Comment 4 arno. 2010-02-19 10:36:34 PST
Created attachment 49091 [details]
patch v2.2

updated patch: last one did not mention added tests/test_utils.c in WebKit/gtk/ChangeLog
Comment 5 Gustavo Noronha (kov) 2010-02-22 09:17:18 PST
Comment on attachment 49091 [details]
patch v2.2

 30 extern int testutils_relative_chdir(const gchar*, const gchar*);

Adding a header, and a proper signature would be better, plus, you should add the bug URL, and its description to the changelog:

 8         Need a short description and bug URL (OOPS!)

Otherwise, this patch is a good step forward, thanks for taking the time to refactor this! One more round to fix up these two small issues, and I'll r+ it.
Comment 6 arno. 2010-02-22 09:52:26 PST
Created attachment 49222 [details]
patch v2.3

updated patch
Comment 7 Gustavo Noronha (kov) 2010-02-23 14:24:05 PST
Comment on attachment 49222 [details]
patch v2.3

Better, thanks!
Comment 8 WebKit Commit Bot 2010-02-23 14:43:30 PST
Comment on attachment 49222 [details]
patch v2.3

Clearing flags on attachment: 49222

Committed r55173: <http://trac.webkit.org/changeset/55173>
Comment 9 WebKit Commit Bot 2010-02-23 14:43:34 PST
All reviewed patches have been landed.  Closing bug.