diff options
author | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-01 21:19:41 +0000 |
---|---|---|
committer | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-01 21:19:41 +0000 |
commit | 7c03692a1fce73101c9943549419c4bc3da38afc (patch) | |
tree | 03465fa1f155bc7aa3ef216df75f69184c5ca56b /webkit | |
parent | 4110be3441ef9666b83842cf746903151165dba2 (diff) | |
download | chromium_src-7c03692a1fce73101c9943549419c4bc3da38afc.zip chromium_src-7c03692a1fce73101c9943549419c4bc3da38afc.tar.gz chromium_src-7c03692a1fce73101c9943549419c4bc3da38afc.tar.bz2 |
Adds --html5-parser flag to test_shell to test out the new HTML5 parsing code
This mirrors the same flag present in DumpRenderTree.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/2477002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48661 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rwxr-xr-x | webkit/glue/webpreferences.cc | 1 | ||||
-rwxr-xr-x | webkit/glue/webpreferences.h | 4 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell.cc | 3 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell.h | 5 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_main.cc | 4 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_switches.cc | 4 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_switches.h | 1 |
7 files changed, 20 insertions, 2 deletions
diff --git a/webkit/glue/webpreferences.cc b/webkit/glue/webpreferences.cc index 0db217c..9a9207c2 100755 --- a/webkit/glue/webpreferences.cc +++ b/webkit/glue/webpreferences.cc @@ -59,6 +59,7 @@ void WebPreferences::Apply(WebView* web_view) const { WebRuntimeFeatures::enableDatabase( WebRuntimeFeatures::isDatabaseEnabled() || databases_enabled); settings->setOfflineWebApplicationCacheEnabled(application_cache_enabled); + settings->setHTML5ParserEnabled(enable_html5_parser); // This setting affects the behavior of links in an editable region: // clicking the link should select it rather than navigate to it. diff --git a/webkit/glue/webpreferences.h b/webkit/glue/webpreferences.h index b34f938..ef4ec2b 100755 --- a/webkit/glue/webpreferences.h +++ b/webkit/glue/webpreferences.h @@ -63,6 +63,7 @@ struct WebPreferences { bool allow_file_access_from_file_urls; bool experimental_webgl_enabled; bool show_composited_layer_borders; + bool enable_html5_parser; // We try to keep the default values the same as the default values in // chrome, except for the cases where it would require lots of extra work for @@ -105,7 +106,8 @@ struct WebPreferences { allow_universal_access_from_file_urls(false), allow_file_access_from_file_urls(false), experimental_webgl_enabled(false), - show_composited_layer_borders(false) { + show_composited_layer_borders(false), + enable_html5_parser(false) { } void Apply(WebKit::WebView* web_view) const; diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc index 0ce4c92..f921a96 100644 --- a/webkit/tools/test_shell/test_shell.cc +++ b/webkit/tools/test_shell/test_shell.cc @@ -105,6 +105,7 @@ class URLRequestTestShellFileJob : public URLRequestFileJob { WindowList* TestShell::window_list_; WebPreferences* TestShell::web_prefs_ = NULL; bool TestShell::developer_extras_enabled_ = false; +bool TestShell::enable_html5_parser_ = false; bool TestShell::inspector_test_mode_ = false; bool TestShell::layout_test_mode_ = false; bool TestShell::allow_external_pages_ = false; @@ -498,6 +499,8 @@ void TestShell::ResetWebPreferences() { // tabbing to links by default. web_prefs_->tabs_to_links = false; + web_prefs_->enable_html5_parser = enable_html5_parser_; + // Allow those layout tests running as local files, i.e. under // LayoutTests/http/tests/local, to access http server. if (layout_test_mode_) diff --git a/webkit/tools/test_shell/test_shell.h b/webkit/tools/test_shell/test_shell.h index 38b1715..9e457c4 100644 --- a/webkit/tools/test_shell/test_shell.h +++ b/webkit/tools/test_shell/test_shell.h @@ -324,6 +324,8 @@ public: return dev_tools_agent_.get(); } + static void enable_html5_parser() { enable_html5_parser_ = true; } + protected: void CreateDevToolsClient(TestShellDevToolsAgent* agent); bool Initialize(const GURL& starting_url); @@ -390,6 +392,9 @@ private: // produce images of the rendered page) static bool allow_external_pages_; + // Whether to use the new HTML5 parsing code. + static bool enable_html5_parser_; + // Default timeout in ms for file page loads when in layout test mode. static int file_test_timeout_ms_; diff --git a/webkit/tools/test_shell/test_shell_main.cc b/webkit/tools/test_shell/test_shell_main.cc index e2eb950..bcd4dfd 100644 --- a/webkit/tools/test_shell/test_shell_main.cc +++ b/webkit/tools/test_shell/test_shell_main.cc @@ -179,6 +179,10 @@ int main(int argc, char* argv[]) { platform.InitializeGUI(); + if (parsed_command_line.HasSwitch(test_shell::kEnableHtml5Parser)) { + TestShell::enable_html5_parser(); + } + TestShell::InitializeTestShell(layout_test_mode, allow_external_pages); if (parsed_command_line.HasSwitch(test_shell::kAllowScriptsToCloseWindows)) diff --git a/webkit/tools/test_shell/test_shell_switches.cc b/webkit/tools/test_shell/test_shell_switches.cc index 2f9c707..050e89d 100644 --- a/webkit/tools/test_shell/test_shell_switches.cc +++ b/webkit/tools/test_shell/test_shell_switches.cc @@ -85,5 +85,7 @@ const char kProfiler[] = "profiler"; const char kHeapProfiler[] = "heap-profiler"; const char kAllowExternalPages[] = "allow-external-pages"; - + +const char kEnableHtml5Parser[] = "html5-parser"; + } // namespace test_shell diff --git a/webkit/tools/test_shell/test_shell_switches.h b/webkit/tools/test_shell/test_shell_switches.h index 46ec7b2..11782ad 100644 --- a/webkit/tools/test_shell/test_shell_switches.h +++ b/webkit/tools/test_shell/test_shell_switches.h @@ -35,6 +35,7 @@ extern const char kGDB[]; extern const char kProfiler[]; extern const char kHeapProfiler[]; extern const char kAllowExternalPages[]; +extern const char kEnableHtml5Parser[]; } // namespace test_shell |