- Persist localStorage data across sessions when a cache path is specified (issue #139).

- Add a localStorage test to cefclient.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@140 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2010-11-17 17:28:32 +00:00
parent 6ad535823a
commit 3dd54c536c
23 changed files with 1035 additions and 14 deletions

View File

@ -533,6 +533,10 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
if(browser.get())
RunUIPluginTest(browser);
return 0;
case ID_TESTS_LOCALSTORAGE: // Test localStorage
if(browser.get())
RunLocalStorageTest(browser);
return 0;
}
}
break;
@ -656,14 +660,20 @@ CefHandler::RetVal ClientHandler::HandleBeforeResourceLoad(
resourceStream = CefStreamReader::CreateForData(
(void*)dump.c_str(), dump.size() * sizeof(wchar_t));
mimeType = L"text/plain";
}
else if(url == L"http://tests/uiapp") {
} else if(url == L"http://tests/uiapp") {
// Show the uiapp contents
if(LoadBinaryResource(IDS_UIPLUGIN, dwSize, pBytes)) {
resourceStream = CefStreamReader::CreateForHandler(
new CefByteReadHandler(pBytes, dwSize, NULL));
mimeType = L"text/html";
}
} else if(url == L"http://tests/localstorage") {
// Show the localstorage contents
if(LoadBinaryResource(IDS_LOCALSTORAGE, dwSize, pBytes)) {
resourceStream = CefStreamReader::CreateForHandler(
new CefByteReadHandler(pBytes, dwSize, NULL));
mimeType = L"text/html";
}
} else if(wcsstr(url.c_str(), L"/ps_logo2.png") != NULL) {
// Any time we find "ps_logo2.png" in the URL substitute in our own image
if(LoadBinaryResource(IDS_LOGO, dwSize, pBytes)) {