[Xfce4-commits] <midori:master> Always use test server instead of example.com in tab_special

Christian Dywan noreply at xfce.org
Mon Nov 26 19:06:06 CET 2012


Updating branch refs/heads/master
         to 9539f746e9ea40f914cbe768344791129a38d7bf (commit)
       from 89a22d3cb09774c1cd5865165ad95474e36cca17 (commit)

commit 9539f746e9ea40f914cbe768344791129a38d7bf
Author: Christian Dywan <christian at twotoasts.de>
Date:   Mon Nov 26 19:05:05 2012 +0100

    Always use test server instead of example.com in tab_special

 tests/tab.vala |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/tests/tab.vala b/tests/tab.vala
index c8c5ce1..1a26935 100644
--- a/tests/tab.vala
+++ b/tests/tab.vala
@@ -72,6 +72,16 @@ static void tab_display_ellipsize () {
 }
 
 void tab_special () {
+    var test_address = new Soup.Address ("127.0.0.1", Soup.ADDRESS_ANY_PORT);
+    test_address.resolve_sync (null);
+    var test_server = new Soup.Server ("interface", test_address, null);
+    string test_url = "http://%s:%u".printf (test_address.get_physical (), test_server.get_port ());
+    test_server.run_async ();
+    test_server.add_handler ("/", (server, msg, path, query, client)=>{
+        msg.set_status_full (200, "OK");
+        msg.response_body.append_take ("<body></body>".data);
+        });
+
     var browser = new Gtk.Window (Gtk.WindowType.TOPLEVEL);
     /*
     var dial = new Midori.SpeedDial ("/", null);
@@ -116,22 +126,12 @@ void tab_special () {
 
     var item = tab.get_proxy_item ();
     item.set_meta_integer ("delay", Midori.Delay.UNDELAYED);
-    tab.set_uri ("http://example.com");
+    tab.set_uri (test_url);
     do { loop.iteration (true); } while (tab.load_status != Midori.LoadStatus.FINISHED);
     assert (tab.can_view_source ());
     assert (!tab.special);
     assert (tab.can_save ());
 
-    var test_address = new Soup.Address ("127.0.0.1", Soup.ADDRESS_ANY_PORT);
-    test_address.resolve_sync (null);
-    var test_server = new Soup.Server ("interface", test_address, null);
-    string test_url = "http://%s:%u".printf (test_address.get_physical (), test_server.get_port ());
-    test_server.run_async ();
-    test_server.add_handler ("/", (server, msg, path, query, client)=>{
-        msg.set_status_full (200, "OK");
-        msg.response_body.append_take ("<body></body>".data);
-        });
-
     tab.set_uri (test_url);
     do { loop.iteration (true); } while (tab.load_status != Midori.LoadStatus.FINISHED);
     assert (!tab.is_blank ());
@@ -144,7 +144,7 @@ void tab_special () {
     var source = new Midori.View.with_title ();
     browser.add (source);
     source.web_view.set_view_source_mode (true);
-    source.web_view.load_uri ("http://example.com");
+    source.web_view.load_uri (test_url);
     do { loop.iteration (true); } while (source.load_status != Midori.LoadStatus.FINISHED);
     assert (!source.is_blank ());
     assert (!source.can_view_source ());


More information about the Xfce4-commits mailing list