瀏覽代碼

Move unregistered portion of driver.t testing to the bottom

The majority of the 01-driver.t test runs against a set of recorded HTTP
request/response pairs. To get a no server response message, we
unregister the PSGI takeover and get access to normal HTTP traffic. But,
we only want to unregister when we no longer need the recorded
pairs. The storage tests do need the recorded pairs, so that test should
go first; alternatively, this test should go last.
Daniel Gempesaw 11 年之前
父節點
當前提交
a7506fe2cd
共有 1 個文件被更改,包括 20 次插入18 次删除
  1. 20 18
      t/01-driver.t

+ 20 - 18
t/01-driver.t

@@ -416,24 +416,6 @@ QUIT: {
     ok((not defined $driver->{'session_id'}), 'Killed the remote session');
 }
 
-NO_SERVER_ERROR_MESSAGE: {
-    LWP::Protocol::PSGI->unregister;
-    my $unused_port = do {
-        my $l = IO::Socket::INET->new(
-            Listen    => 5,
-            LocalHost => '127.0.0.1',
-            LocalPort => 0,
-            Proto     => 'tcp',
-            ReuseAddr => 1,
-        ) or die $!;
-        $l->sockport;
-    };
-    eval {
-        my $sel = Selenium::Remote::Driver->new(port => $unused_port);
-    };
-    unlike($@, qr/Use of uninitialized value/, "Error message for no server at host/port combination is helpful");
-}
-
 STORAGE: {
     my $chrome;
 
@@ -459,4 +441,24 @@ STORAGE: {
     }
 }
 
+NO_SERVER_ERROR_MESSAGE: {
+    LWP::Protocol::PSGI->unregister;
+    my $unused_port = do {
+        my $l = IO::Socket::INET->new(
+            Listen    => 5,
+            LocalHost => '127.0.0.1',
+            LocalPort => 0,
+            Proto     => 'tcp',
+            ReuseAddr => 1,
+        ) or die $!;
+        $l->sockport;
+    };
+    eval {
+        my $sel = Selenium::Remote::Driver->new(port => $unused_port);
+    };
+    unlike($@, qr/Use of uninitialized value/, "Error message for no server at host/port combination is helpful");
+}
+
+
+
 done_testing;