Commit Graph

50336 Commits

Author SHA1 Message Date
Fredrik Holmqvist
ded5af13dc Fix spelling error. 2014-06-10 23:09:03 +02:00
Adrien Destugues
0256e7a458 Disable the MIME type test.
* This tests requires some private APIs which have been changed, it
needs to be rewritten.
* I'm also not sure if it's still possible to work on a copy of the MIME
* database to avoid messing with the system one.
2014-06-10 10:10:30 +02:00
Adrien Destugues
182a5f8e53 Disable test for TranslatorResoter::Version
* The method was made private and deprecated, so there is no way to
compile code calling it directly.
2014-06-10 10:09:13 +02:00
Adrien Destugues
64e8975369 ResourcesTest: fix build.
* There are several SetTo methods, specify the one we want to test.
2014-06-10 10:08:34 +02:00
John Scipione
888f72ca9a Tracker: close Desktop window on switch to spatial mode
If you have the Desktop window open when you switch to spatial
mode this will now close the window. You aren't allowed to have
the Desktop open in 2 places symultaneously in spatial mode.
2014-06-10 00:59:50 -04:00
John Scipione
646b1fe1e8 Tracker: Open Desktop folder in own window in browser mode.
... in a few more cases.

If you are in spatial mode and you double-click on the Desktop folder
it activates the Desktop putting all other Tracker windows in the
background.

If you are in browser mode and you double-click on the Desktop folder
it opens the Desktop folder in the current window.

If you issue 'open ~/Desktop' from Terminal or if you have Expander set
to open the expanded folder and you expand something on the Desktop
it won't open the Desktop folder in its own window in either spatial or
browser mode.

This patch alters Trackers behavior to  open the Desktop folder in its own
window in these cases when you are in browser mode.

One might argue (as a few have on IRC) that this behavior should also
happen in spatial mode, but, this patch does not alter the behavior of
spatial mode. In spatial mode opening the Desktop folder with
'open ~/Desktop' or extracting a zip file with Expander on the Desktop
simply activates the Desktop pushing all other Tracker windows into the
background state.

Fixes #10929
2014-06-10 00:57:33 -04:00
John Scipione
157e4b428a Tracker: Replace max_c() with std::max() 2014-06-10 00:36:11 -04:00
John Scipione
9437e677ba Tracker: Style fixes 2014-06-10 00:36:10 -04:00
John Scipione
12bd3f0452 Expander: Replace min_c() and max_c()
...with std::min() and std::max()
2014-06-09 15:56:39 -04:00
John Scipione
be931d0706 Expander: Check asprintf() return value 2014-06-09 15:56:27 -04:00
John Scipione
122abe4315 Expander: Check Window()->Lock() return value 2014-06-09 15:56:26 -04:00
John Scipione
1e35cfaea2 Expander: replace string manip with asprintf() 2014-06-09 15:56:26 -04:00
John Scipione
e326cef620 Expander: style fixes, no functional change intended 2014-06-09 15:56:25 -04:00
Jérôme Duval
d64267ffb2 vfs: checks whether the mount's unmounting flag is already set.
* thanks to Ingo for suggesting the idea, quoting him:
"by holding sVnodeLock read-locked, get_mount() ensures that fs_unmount() can't
process the nodes. If it is already past that point, the root node check
(not NULL, not busy, ref count > 0) is supposed to detect that. But it doesn't
look like this can work. fs_unmount() doesn't set the root node to NULL (the
root node field is NULL only during a short period in fs_mount()), but it just
frees the nodes after releasing sVnodeLock. So the not busy and ref count > 0
checks could already access freed memory".
* tested OK, this fixes #10522.
* replaced mount->root_vnode by the local variable with the same value.
2014-06-09 21:45:28 +02:00
Fredrik Holmqvist
ec10d307d0 Really fix gcc4 build.
Here I come to save the day!!
2014-06-09 21:07:29 +02:00
Adrien Destugues
942cf5fdbc Fix gcc4 build. 2014-06-09 18:21:42 +02:00
Adrien Destugues
d306340b66 Don't include number_format tests
* The class isn't currently included in Haiku
* Test test only checks that the constructor doesn't crash, which isn't
very helpful anyway
2014-06-09 17:24:28 +02:00
Adrien Destugues
9570413d2a Fix name conflict between two tests
* There is a SimpleTest in AlertTest.cpp, and an UnitTest in
balert/AlertTest.cpp. They ended up with the same grist as they are
built from the same jamfile. Rename one of them to avoid this.
2014-06-09 17:18:13 +02:00
Adrien Destugues
913e376500 Match linked list tests with the current API. 2014-06-09 17:09:23 +02:00
Adrien Destugues
49a6a0ebf3 Fix build of makeudfimage tests.
* The Udf namespace was removed from the headers, but not all the
implementation files
* kernel_cpp.h is not actually used
* TRACE_ERROR can't be set to dprintf when building as part of the test
(and not as a kernel add-on)

First step on the way to get jam -q unittests to work again...
2014-06-09 16:06:00 +02:00
Adrien Destugues
080f5d5f5d ProtocolListener test: fix build.
* I'm not sure what this is supposed to test...
2014-06-09 14:42:22 +02:00
Adrien Destugues
0e79d0efbc Disable tracing unless built in debug mode. 2014-06-09 14:12:56 +02:00
Adrien Destugues
3af9a2cac2 Make HttpRequest tests use the test framework
* Use httpbin.org as a server, rather than a local machine.
* Also add an HTTPS version
2014-06-09 14:11:15 +02:00
Adrien Destugues
f38d4d4510 Rename url directory to "service"
* All "services kit" tests will move there.
2014-06-09 11:18:00 +02:00
Adrien Destugues
1cbab031fd More relaxing of cookie-setting rules
* Allow non-secure page to set (but not read) secure cookies
* Allow pages to set cookies for subdomains (but not access them)
2014-06-09 11:17:49 +02:00
Adrien Destugues
d888718621 HttpTime: don't try to parse timezone
* Cookies sometimes come with the UTC timezone, or no tz info at all.
* No other timezone seems to be used

This allows better matching of cookies which would otherwise be kept
only as session cookies.
2014-06-09 11:10:19 +02:00
Adrien Destugues
744bfa6270 Convert existing cookie test to test framework
* The remaining stress-test is a benchmark, and has no success/failure
result. Leave it this way for now.
2014-06-09 11:08:16 +02:00
Adrien Destugues
f7e7eeba4a Limit cookie value size to 4096 bytes.
Too big cookies will make most web servers reject requests.
2014-06-09 08:50:29 +02:00
Stefano Ceccherini
056b2e33e5 ifconfig: fail with a warning if called on a non-existent interface. 2014-06-08 18:59:00 +02:00
Jessica Hamilton
a0b864f0e4 BString: fix possible infinite loop in _DoReplace 2014-06-08 04:37:16 +12:00
Jérôme Duval
2f32fd1dde wchar.h & string.h: use _GNU_SOURCE instead of __USE_GNU. 2014-06-07 11:22:38 +02:00
Jérôme Duval
a3b79608f9 search.h: fix typo.
* Thanks diger for noticing.
2014-06-07 10:54:15 +02:00
autonielx
b0e9612fc4 Update translations from Pootle 2014-06-07 06:19:20 +02:00
Jessica Hamilton
5700f5fcc3 libroot.so: update glibc's e_pow.S on x86. Fixes #9962 2014-06-07 09:33:15 +12:00
John Scipione
5fe7d79d30 Terminal: Fix crash when changing window size
... try 2 without a spurious \

sorry for the noise.

From the commits list (Ingo) <<-EOF

> Terminal crashes because fView is not connected to App Server when
> this is called so calling fView->GetMouse() is not allowed.

The interesting questions therefore are:

1) Why is the view not attached?
2) Why is it in the hyper link state?

1) is because the BTabView removes the non-selected tabs instead of just
   hiding them.

The reason for 2) is that the tab was opened with Cmd+T (the bug is not
reproducible when the tab is opened via menu item). Pressing Cmd causes
hyper link state to be entered and switching to the new tab will leave
the view in that state due to 1).

Possible solutions:

* TermView::_VisibleTextBufferChanged(): Call state hook only when attached
  to window. All other occurrences are safe as they are in BView hooks.

* Leave the hyper link state when the view is detached from the window. A
  new dummy state could be active as long as the view is not attached, though
  using DefaultState would be harmless as well.

EOF

I chose solution 2 using DefaultState rather than creating a new dummy state.

Thanks Ingo.

Fixes #10902
2014-06-06 15:28:36 -04:00
John Scipione
0bdf33686c Revert "Terminal: Fix crash when changing window size."
This reverts commit d3657dc2bc.
2014-06-06 15:27:20 -04:00
John Scipione
d3657dc2bc Terminal: Fix crash when changing window size.
From the commits list (Ingo) <<-EOF

> Terminal crashes because fView is not connected to App Server when
> this is called so calling fView->GetMouse() is not allowed.

The interesting questions therefore are:

1) Why is the view not attached?
2) Why is it in the hyper link state?

1) is because the BTabView removes the non-selected tabs instead of just
   hiding them.

The reason for 2) is that the tab was opened with Cmd+T (the bug is not
reproducible when the tab is opened via menu item). Pressing Cmd causes
hyper link state to be entered and switching to the new tab will leave
the view in that state due to 1).

Possible solutions:

* TermView::_VisibleTextBufferChanged(): Call state hook only when attached
  to window. All other occurrences are safe as they are in BView hooks.

* Leave the hyper link state when the view is detached from the window. A
  new dummy state could be active as long as the view is not attached, though
  using DefaultState would be harmless as well.

EOF

I chose solution 2 using DefaultState rather than creating a new dummy state.

Thanks Ingo.

Fixes #10902
2014-06-06 15:14:15 -04:00
Adrien Destugues
7f1f341e5f Forgot to commit changes to the header. 2014-06-06 19:11:03 +02:00
Adrien Destugues
cb7d1c5ecd Add some more tests for cookies
Also derived from Opera test suite.
* Fix nbsp instead of space in some tests (I shouldn't have copypasted
these...)
* Add most of the advanced tests from Opera. This exposed several bugs
in the cookie code (all fixed) as well as strptime and strtol (tickets
opened)
* All the cookie2 tests are skipped. I didn't find any use of it on the
internets, so it doesn't seem useful to implement it.
* The last two tests sets are still missing. I'll add them next week.
2014-06-06 18:42:11 +02:00
Adrien Destugues
550f5b1c95 Fix some issues detected by the testsuite
* An empty "expires" field results in a session cookie, rather than
rejecting the cookie altogether
* A page can set a cookie it is not allowed to access (for example in a
subdirectory of where the page is located). Separate IsValidForUrl and
_CanBeSetFromUrl to perform the appropriate checks in each case.
* Limit cookie path to 4096 characters. As a result of the previous
change, a page would be allowed to set a cookie with an aribrarily long
subpath, wasting disk space and RAM by growing hte cookie jar.
* Don't allow path with . or .. elements. These are a source of
confusion and are not needed.
* Reset the cookie fields when parsing failed. This does not matter when
using the cookie jar, but is useful when working directly with
BNetworkCookie.
2014-06-06 16:53:50 +02:00
Adrien Destugues
fed9b96e26 Better handling of parse errors in HttpTime
strptime can return non-NULL values even if it only parsed part of the
string. This was sometimes making us use the wrong format. Now we try
all formats and checks how much of the string strptime managed to parse.
We stop when it has parsed a big enough part of it.
2014-06-06 16:49:11 +02:00
Adrien Destugues
6ac7ba848b Sort cookies by path length (longest first)
* This makes sure the most specific cookies are sent first, matching
what other browsers do.
2014-06-06 16:48:15 +02:00
Adrien Destugues
4e14963b73 CID 1108421: BUrl constructor missing initializers. 2014-06-06 08:04:16 +02:00
czeidler
76207e934d Add gcc4 ALE package. 2014-06-06 10:58:54 +12:00
Stephan Aßmus
3df9235571 HttpRequest.h: Fixed some formatting 2014-06-06 00:23:48 +02:00
Stephan Aßmus
5eba63a680 UrlContext: Improved comment 2014-06-06 00:23:47 +02:00
Stephan Aßmus
cb1a99c5f0 HttpHeaders: Small code refactorings
Also check BList::Add() for success when adding a BHttpHeader.
2014-06-06 00:23:47 +02:00
Stephan Aßmus
79852c5551 HttpHeaders: Check assigning self in operator=() 2014-06-06 00:23:46 +02:00
John Scipione
7a214200ed Revert "TermViewStates: Check if fView is NULL before using it."
This reverts commit b84955c738.
2014-06-05 18:02:44 -04:00
John Scipione
4bf5fb9252 Revert "Fix #10902 Terminal crashes setting window size."
This reverts commit 4c8d238716.
2014-06-05 18:02:33 -04:00