This source file includes following definitions.
- SimpleTest
- IN_PROC_BROWSER_TEST_F
- IN_PROC_BROWSER_TEST_F
#include "base/path_service.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/common/dom_storage/dom_storage_types.h"
#include "content/public/common/content_paths.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_browser_test.h"
#include "content/public/test/content_browser_test_utils.h"
#include "content/shell/browser/shell.h"
#include "net/base/net_util.h"
namespace content {
class DOMStorageBrowserTest : public ContentBrowserTest {
public:
DOMStorageBrowserTest() {}
void SimpleTest(const GURL& test_url, bool incognito) {
Shell* the_browser = incognito ? CreateOffTheRecordBrowser() : shell();
NavigateToURLBlockUntilNavigationsComplete(the_browser, test_url, 2);
std::string result =
the_browser->web_contents()->GetLastCommittedURL().ref();
if (result != "pass") {
std::string js_result;
ASSERT_TRUE(ExecuteScriptAndExtractString(
the_browser->web_contents(),
"window.domAutomationController.send(getLog())",
&js_result));
FAIL() << "Failed: " << js_result;
}
}
};
static const bool kIncognito = true;
static const bool kNotIncognito = false;
IN_PROC_BROWSER_TEST_F(DOMStorageBrowserTest, SanityCheck) {
SimpleTest(GetTestUrl("dom_storage", "sanity_check.html"), kNotIncognito);
}
IN_PROC_BROWSER_TEST_F(DOMStorageBrowserTest, SanityCheckIncognito) {
SimpleTest(GetTestUrl("dom_storage", "sanity_check.html"), kIncognito);
}
}