Changeset 109720 in webkit
- Timestamp:
- Mar 5, 2012 12:35:15 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/gtk/ChangeLog
r109719 r109720 1 2012-03-04 Martin Robinson <mrobinson@igalia.com> 2 3 [GTK] "Console: undefined @0: ReferenceError: Can't find variable: WebInspector" during testwebinspector 4 https://bugs.webkit.org/show_bug.cgi?id=80235 5 6 Reviewed by Philippe Normand. 7 8 Wait to inspect the WebView until the page has finished loading. Also 9 clean up some minor style errors. 10 11 * tests/testwebinspector.c: 12 (closeInspector): Small style fixes. 13 (showInspector): Ditto. 14 (loadFinished): Ditto. 15 (test_webkit_web_inspector_close_and_inspect): Wait to inspect until the page has loaded. 16 (test_webkit_web_inspector_destroy_inspected_web_view): Ditto. 17 (main): Small style fixes. 18 1 19 2012-03-04 Martin Robinson <mrobinson@igalia.com> 2 20 -
trunk/Source/WebKit/gtk/tests/testwebinspector.c
r106851 r109720 63 63 } 64 64 65 static gboolean closeInspector 65 static gboolean closeInspector(WebKitWebInspector *inspector, int *timesClosed) 66 66 { 67 67 *timesClosed = *timesClosed + 1; … … 71 71 } 72 72 73 static gboolean showInspector 73 static gboolean showInspector(WebKitWebInspector *inspector, gpointer data) 74 74 { 75 75 g_idle_add(quitLoop, NULL); … … 77 77 } 78 78 79 static void loadFinished(WebKitWebView *webView, WebKitWebFrame *frame, gboolean *isLoadFinished) 80 { 81 *isLoadFinished = TRUE; 82 if (g_main_loop_is_running(loop)) 83 g_main_loop_quit(loop); 84 } 85 79 86 static void test_webkit_web_inspector_close_and_inspect() 80 87 { 81 88 WebKitWebView *webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); 89 loop = g_main_loop_new(NULL, TRUE); 82 90 83 WebKitWebSettings *settings = webkit_web_view_get_settings(webView); 84 g_object_set(settings, "enable-developer-extras", TRUE, NULL); 91 gboolean isLoadFinished = FALSE; 92 g_signal_connect(webView, "load-finished", G_CALLBACK(loadFinished), &isLoadFinished); 93 webkit_web_view_load_string(webView, 94 "<html><body><p>woohoo</p></body></html>", 95 "text/html", "UTF-8", "file://"); 96 if (!isLoadFinished) 97 g_main_loop_run(loop); 85 98 86 webkit_web_view_load_string (webView, 87 "<html><body><p>woohoo</p></body></html>", 88 "text/html", "UTF-8", "file://"); 89 99 g_object_set(webkit_web_view_get_settings(webView), "enable-developer-extras", TRUE, NULL); 90 100 WebKitWebInspector *inspector = webkit_web_view_get_inspector(webView); 91 101 … … 101 111 g_assert_cmpint(timesElementInspected, ==, 1); 102 112 103 loop = g_main_loop_new(NULL, TRUE);104 113 g_main_loop_run(loop); 105 114 … … 121 130 { 122 131 WebKitWebView *webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); 132 loop = g_main_loop_new(NULL, TRUE); 123 133 124 WebKitWebSettings *settings = webkit_web_view_get_settings(webView); 125 g_object_set(settings, "enable-developer-extras", TRUE, NULL); 134 gboolean isLoadFinished = FALSE; 135 g_signal_connect(webView, "load-finished", G_CALLBACK(loadFinished), &isLoadFinished); 136 webkit_web_view_load_string(webView, 137 "<html><body><p>woohoo</p></body></html>", 138 "text/html", "UTF-8", "file://"); 139 if (!isLoadFinished) 140 g_main_loop_run(loop); 126 141 127 webkit_web_view_load_string (webView, 128 "<html><body><p>woohoo</p></body></html>", 129 "text/html", "UTF-8", "file://"); 130 142 g_object_set(webkit_web_view_get_settings(webView), "enable-developer-extras", TRUE, NULL); 131 143 WebKitWebInspector *inspector = webkit_web_view_get_inspector(webView); 132 144 … … 142 154 g_assert_cmpint(timesElementInspected, ==, 1); 143 155 144 loop = g_main_loop_new(NULL, TRUE);145 156 g_main_loop_run(loop); 146 157 … … 155 166 gtk_test_init(&argc, &argv, NULL); 156 167 157 testutils_relative_chdir("Programs/resources/inspector/inspector.html", argv[0]);158 159 char *currentDir = g_get_current_dir();160 g_setenv("WEBKIT_INSPECTOR_PATH", currentDir, TRUE);161 g_free(currentDir);162 163 168 g_test_bug_base("https://bugs.webkit.org/"); 164 169 g_test_add_func("/webkit/webinspector/destroy-inspected-web-view", test_webkit_web_inspector_destroy_inspected_web_view); 165 170 g_test_add_func("/webkit/webinspector/close-and-inspect", test_webkit_web_inspector_close_and_inspect); 166 171 167 return g_test_run 172 return g_test_run(); 168 173 } 169 174 -
trunk/Tools/ChangeLog
r109719 r109720 1 2012-03-04 Martin Robinson <mrobinson@igalia.com> 2 3 [GTK] "Console: undefined @0: ReferenceError: Can't find variable: WebInspector" during testwebinspector 4 https://bugs.webkit.org/show_bug.cgi?id=80235 5 6 Reviewed by Philippe Normand. 7 8 * Scripts/run-gtk-tests: 9 (TestRunner.run): Use the WEBKIT_INSPECTOR_PATH environment variable so that 10 inspector resources path determination is shared by all tests. 11 1 12 2012-03-04 Martin Robinson <mrobinson@igalia.com> 2 13 -
trunk/Tools/Scripts/run-gtk-tests
r105736 r109720 90 90 test_env = os.environ 91 91 test_env["DISPLAY"] = ":55" 92 test_env["WEBKIT_INSPECTOR_PATH"] = os.path.abspath(os.path.join(self._programs_path, 'resources', 'inspector')) 92 93 93 94 exit_status = [0]
Note: See TracChangeset
for help on using the changeset viewer.