Jacek Caban (@jacek) commented about dlls/mshtml/tests/events.c:
+#define check_local_onstorage(a,b,c,d) _check_onstorage(a,b,c,d,TRUE,__LINE__) +#define check_session_onstorage(a,b,c,d) _check_onstorage(a,b,c,d,FALSE,__LINE__) +static void _check_onstorage(unsigned idx, const WCHAR *key, const WCHAR *old_value,
const WCHAR *new_value, BOOL local, unsigned line)
+{
- const int *expect;
- MSG msg;
- onstorage_expect_line = line;
- onstorage_expect_key = key;
- onstorage_expect_old_value = old_value;
- onstorage_expect_new_value = new_value;
- if(local) {
static const int e[] = { EXPECT_DOC_ONSTORAGECOMMIT, -1 };
This really makes the code harder to follow than needed. Can you just use the existing mechanisms instead? The only thing it's lacking is testing for call order (and that's intentional). Is testing the order really worth all the complication and all those magic 0, 1, 2 and -1s? If you really need to check the order, you may just check in doc.onstorage than window.onstorage was already called.